gillescastel / inkscape-shortcut-manager

Inkscape shorcut manager
MIT License
360 stars 98 forks source link

Super_L not working in Inkscape window #3

Closed xandhiller closed 4 years ago

xandhiller commented 5 years ago

Hi Gilles,

When running the script I am unable to use my left Super key, meaning many of my i3wm bindings are not available to me when I'm in the inkscape window. It means I can't quickly move windows or do regular commands if my focus is on inkscape.

I'm wondering if you have any pointers on how to remedy this by perhaps altering normal.py using Xlib? Or perhaps the issue is somewhere else in the project.

Appreciate any help.

gillescastel commented 5 years ago

That's annoying and shouldn't happen. I'm using bspwm/sxhkd myself and don't have problems using the left Super key. The relevant code is the following, which should normally ungrab Super_L:

https://github.com/gillescastel/inkscape-shortcut-manager/blob/591ffe2d0be2ef0e60bd9362dd147274e173b9b0/main.py#L42-L47

Try adding the following lines in main.py

 class Manager():
     ...
     def listen(self):
+        print('keycode of Super_L:', self.string_to_keycode('Super_L'))
         self.grab()
         while True:
             evt = self.disp.next_event()
             if evt.type in [X.KeyPress, X.KeyRelease]:
                 keycode = evt.detail
+                print('keycode', keycode)
                 keysym = self.disp.keycode_to_keysym(keycode, 0)
                 char = XK.keysym_to_string(keysym)
                 self.disp.allow_events(X.ReplayKeyboard, X.CurrentTime)

and pressing your super key in an Inkscape window. What do you get?

gillescastel commented 4 years ago

Closing this due to inactivity. Feel free to reopen if you still have this issue