On some occasions, you may want to get a "global" input language - that is, the keyboard layout used by the current foreground window\application\whatever. Basically, simulating the behaviour of the language panel on Windows.
The common use cases are on-screen keyboards, fullscreen applications, and widgets.
While I wasn't able to find a premade function that get this particular thing during my searches, it turned out not to be too hard to assemble:
Continue reading