I have a Python/pygI program which shows a window with buttons with various characters, primarily the ones that are not found on standard keyboard. (€æÜÄØá¿ etc)
And I have, say, Gedit open. I have made my program's window unfocusable, so the Gedit's window remains in focus when I press a button in my program's window.
My problem is: when I press a button with a character in my program's window, I want it to be automatically typed into Gedit's window. So it's some kind of an auxiliary on-screen keyboard with rare symbols.
My current method of doing it is via clipboard, but it's tedious because
- it contaminates the clipboard
- I have to Ctrl+V every time to put the symbol into Gedit.
Is there a way to put a symbol into an active window from Python program? Maybe I should use some Linux utilities via subprocessing? Maybe there is even a way to do it via means of Gtk? Or maybe I can manipulate the clipboard somehow so it would put a character there, automatically paste it to Gedit and put the original clipboard contents back?
EDIT1: I am using X window system in Ubuntu 14.04.