gillescastel/inkscape-shortcut-manager

Super_L not working in Inkscape window

Closed this issue · 2 comments

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.

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:

def grab(self):
self.inkscape.grab_key(X.AnyKey, X.AnyModifier, True, X.GrabModeAsync, X.GrabModeAsync)
# Ungrab window manager shortcuts (Super + ...)
self.inkscape.ungrab_key(self.string_to_keycode('Super_L'), X.AnyModifier, True)
self.inkscape.change_attributes(event_mask=X.KeyReleaseMask | X.KeyPressMask | X.StructureNotifyMask)

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?

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