![]() |
How can I get keypress events from virtual keyboard in python?
I'm porting to the N8x0 a pygtk application which uses keypress events. It works fine with the hardware keyboard, but the virtual keyboard doesn't seem to emit keypress events, except for the enter and backspace keys.
Is there any way to get keypress events when using the virtual keyboard? |
Re: How can I get keypress events from virtual keyboard in python?
Quote:
Could make your own :) - http://www.ossramblings.com/pygame_virtual_keyboard |
Re: How can I get keypress events from virtual keyboard in python?
Quote:
Code:
"changed" The "insert-text" signal is emitted when text is inserted into the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with the gobject.stop_emission() method, it is possible to prevent it from being inserted entirely. The position parameter is a gobject.GPointer object containing a pointer to the insertion position - there is no way to access the position value from PyGTK. |
Re: How can I get keypress events from virtual keyboard in python?
Yes, it seems the only way is to override the do_insert_text method from the gtk.Editable interface. For now, I settled to using the TAB key (the event of interest was triggered by the space key).
Now, another question: How can I set the taskbar icon? No matter how much I try, it seems I can't do it. I have copied the icon to /usr/share/pixmaps and /usr/share/icons/hicolor/26x26/hildon, updated the icon cache, and created a .desktop file. The icon shows in the menu, but not in the taskbar. gtk.window_set_default_icon() doesn't seem to work. |
Re: How can I get keypress events from virtual keyboard in python?
Quote:
It's been a looong time since I've dealt with icon issues on the N8x0 (Fremantle is nicer in this regard, with the menu icon being the only thing you have to worry about :)) so all I can offer is general hints (sorry if these come off as "No ****, Sherlock"). * The icon in /usr/share/icons/hicolor/26x26/hildon is a 26x26 PNG, with the same file name as the the one in /usr/share/pixmaps etc.? * You have a 64x64 PNG in /usr/share/icons/hicolor/scalable/hildon? * In your desktop file, you aren't trying to set the icon directory or the WMClass? * Hildon-desktop takes notice of the X-Window-Icon and X-Window-Icon-Dimmed fields in the desktop file if all else fails. |
Re: How can I get keypress events from virtual keyboard in python?
Thanks, after much renaming and linking I finally got it (the png file has to have the same name as the executable), but your hints will allow me to do it right once and for all :)
|
Re: How can I get keypress events from virtual keyboard in python?
Quote:
|
All times are GMT. The time now is 06:42. |
vBulletin® Version 3.8.8