sdlterm/cython/sdlterm.pyx
changeset 67 71f60bf6ebb7
parent 57 911927edbdde
child 69 4e7be77bafff
equal deleted inserted replaced
66:824a9837bbb3 67:71f60bf6ebb7
    11 
    11 
    12 cdef extern from "sdlterm.h":
    12 cdef extern from "sdlterm.h":
    13     cdef struct Event_key:
    13     cdef struct Event_key:
    14         char *keyname
    14         char *keyname
    15         Py_UNICODE unicode
    15         Py_UNICODE unicode
       
    16         int mod
    16 
    17 
    17     cdef struct Event_mouse:
    18     cdef struct Event_mouse:
    18         int x, y
    19         int x, y
    19         int button
    20         int button
    20 
    21 
   105             else:
   106             else:
   106                 keyname = None
   107                 keyname = None
   107             char = event.key.unicode
   108             char = event.key.unicode
   108             if char == '\x00':
   109             if char == '\x00':
   109                 char = None
   110                 char = None
   110             return ('keypress', keyname, char)
   111             mod = event.key.mod
       
   112             return ('keypress', keyname, char, mod)
   111         if event.type == event.RESIZE:
   113         if event.type == event.RESIZE:
   112             return ('resize',)
   114             return ('resize',)
   113         if event.type == event.QUIT:
   115         if event.type == event.QUIT:
   114             return ('quit',)
   116             return ('quit',)
   115         return ('unknown',)
   117         return ('unknown',)