pys60:按键事件响应

# import modules
import appuifw, e32, key_codes 
# define functions to show notifications
def up():
    appuifw.note(u"Arrow up was pressed")
    
def two():
    appuifw.note(u"Key 2 was pressed")   
 
def quit():
    app_lock.signal()
# Create Canvas object
canvas = appuifw.Canvas()
appuifw.app.body = canvas
# Bind keys
canvas.bind(key_codes.EKeyUpArrow, up)
canvas.bind(key_codes.EKey2, two)
# Exit handling
appuifw.app.exit_key_handler = quit
app_lock = e32.Ao_lock()
app_lock.wait()


你可能感兴趣的:(UP,Nokia)