[maemo-developers] hardware key access using Phyton
From: Martin Grimme martin.grimme at gmail.comDate: Sun Dec 2 17:47:56 EET 2007
- Previous message: hardware key access using Phyton
- Next message: hardware key access using Phyton
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
The hardware keys simply map to standard keys on a PC keyboard.
Do something like this:
def on_key(src, ev):
    keyval = ev.keyval
    key = gtk.gdk.keyval_name(keyval)
    if (key == "Escape"):
        do_ something()
    elif (key == "F6"):         # fullscreen button
        do_something()
    elif (key == "F7"):
        do_something()        # + button
    elif (key == "F8"):
        do_something()        # - button
win = hildon.Window()
win.connect("key-press-event", on_key)
Cheers,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20071202/e4603832/attachment.htm 
    - Previous message: hardware key access using Phyton
- Next message: hardware key access using Phyton
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
