Commits

A2K  committed 92ee45d

Make shortcuts work when numlock is off

  • Participants
  • Parent commits 525406a

Comments (0)

Files changed (1)

File shortcuts.py

         self.root.change_attributes(event_mask = X.KeyPressMask)
         for key in self.keys:
             try:
-                self.root.grab_key(key[0], key[1] & ~(X.AnyModifier << 1),
+                self.root.grab_key(key[0], key[1],
+                                   True, X.GrabModeAsync, X.GrabModeAsync)
+                self.root.grab_key(key[0], key[1] | 1<<4,
                                    True, X.GrabModeAsync, X.GrabModeAsync)
             except Exception as e:
                 print dir(e)
     def handle(self):
         while self.active:
             event = self.root.display.next_event()
+            log.debug("Got event %s" % str(event))
             if event.type == X.KeyPress:
                 keycode = event.detail
                 for key in self.keys: