23 |
|
|
24 |
class MyModule(module.Module): |
class MyModule(module.Module): |
25 |
|
|
26 |
my_events = [X.ButtonPress, X.KeyPress, X.KeyRelease] |
my_events = [X.ButtonPress, X.KeyPress, X.KeyRelease, X.MotionNotify] |
27 |
|
|
28 |
def load(self): |
def load(self): |
29 |
pass |
pass |
30 |
|
|
31 |
def handle_event(self,event): |
def handle_event(self,event): |
32 |
if event.type == X.ButtonPress: |
if event.type == X.ButtonPress: |
33 |
print "Keybinding module received an event of type:", event.type |
print "X.ButtonPress" |
34 |
print self.display.get_display_name() |
|
35 |
|
if event.type == X.KeyPress: |
36 |
|
print "X.Keypress" |
37 |
|
|
38 |
|
if event.type == X.MotionNotify: |
39 |
|
print event.root_x, "x", event.root_y |