[maemo-developers] hildon im to X key proxy
From: Eero Tamminen eero.tamminen at nokia.comDate: Mon Jan 21 10:50:42 EET 2008
- Previous message: hildon im to X key proxy
- Next message: hildon im to X key proxy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, ext Austin Che wrote: > I've been trying to get something like the following to work: > > - I want to be able to press power, menu or something like that to > bring up the on-screen keyboard > - Then any keys I press should be sent as normal X key events > (i.e. same as if I pressed them on a keyboard) > - If I press a hardware key like the menu button, the next key > pressed on the vkb is sent as a ctrl character instead You could use something like matchbox-nest: http://packages.debian.org/etch/matchbox-keyboard > Here's my current implementation: > > - I create a hidden window. I create a new hildon IM context and > set the hidden window to be the client. > - Keys pressed on the vkb are caught via the "commit" signal and > converted to a unicode character. > - I use gdk_unicode_to_keyval to convert it to a GDK keyval which > I believe has a 1-to-1 mapping to X keysyms Unicode covers a much larger range than X keysyms. > - XChangeKeyboardMapping is used to set an arbitrary unused > keycode to map to the desired keysym > - I then use XTest to generate a fake key of the given keycode > > It mostly works but there are some issues: > > - I cannot make a completely hidden window. The best I can do is a > 1x1 pixel window that shows up as a white dot in the top left > corner. Making it zero size, moving it off screen, or trying to > make it transparent don't seem to work. > > - I set the hidden window to not accept-focus. This is so that > when I use XTestFakeKeyEvent, the key is sent to the current top > application. However, this also means the hidden window cannot > directly get the hardware key presses. I can get it in other ways > such as directly from the device file, but it seems like there > should be a better solution. If I give the hidden proxy window the > focus, I can't figure out how to lose the focus before sending the > fake key. > > - When using it with something like the X terminal which normally > pops up the vkb itself, it works for a couple characters (not > repeatable how many characters) and then my proxy stops receiving > keyboard events. I believe it's because the app realizes it has > the focus and it resets the client window for the vkb to be > itself. This problem doesn't exist when I use it with something > that doesn't normally pop up the vkb (e.g. running emacs over X > remotely). If there was some way to determine when the client > window for the vkb has changed, that would probably be good enough > to reset it back to the proxy window. > > - Normally, when the vkb pops up, the window underneath is > automatically resized. But when doing the above, the top window is > not resized so it ends up that the keyboard covers the bottom of > the window. How can I force the window underneath to resize? The application tells the window manager for which window the keyboard is opened with an X property I think. > - Is there some way to tell when the vkb has been hidden by the > user? > > Any hints appreciated. - Eero
- Previous message: hildon im to X key proxy
- Next message: hildon im to X key proxy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]