View Single Post
Posts: 146 | Thanked: 15 times | Joined on Oct 2008
#12
Originally Posted by daperl View Post
Does anyone know what the keysyms are for the d-pad?
http://maemomm.garage.maemo.org/docs...l/ch02s03.html

You can also use "... if event.keyval == 65307:" for the back key.

If so, catching and subsuming their events should be as simple as:

Code:
...
window = gtk.Window()
window.connect("key-press-event", on_key_press)
...
def on_key_press(widget, event, *args):
    returnValue = False
    ....
    if event.keyval == gtk.keysyms.<DPAD_LEFT> or\
    event.keyval == gtk.keysyms.<DPAD_RIGHT> or\
    event.keyval == gtk.keysyms.<DPAD_UP> or\
    event.keyval == gtk.keysyms.<DPAD_DOWN>:
        ...
        returnValue = True
    ...
    return returnValue
...
The "returnValue = True" is the import part because it will keep these events from propagating.
It worked!


EDIT:

I tested this by just returning True and it worked.
This worked, but also disabled completely the arrow keys, like when choosing an item in a listore. I will use the first suggestion then

Thanks A LOT!!
L.
 

The Following User Says Thank You to luis For This Useful Post: