dylanaraps / sowm

An itsy bitsy floating window manager (220~ sloc!).
MIT License
905 stars 70 forks source link

some keybindings does not works on non-QWERTY keyboard layouts #100

Closed dashezup closed 3 years ago

dashezup commented 3 years ago

I'm using Programmer Dvorak keyboard layout, with the default config.h, most keybindings does not works.

try setxkbmap us dvp to switch to Programmer Dvorak keyboard layout to reproduce this

MOD+Return works MOD+d does not work

But if I add another keybinding MOD+e, then MOD+e will work. MOD+e won't work if I remove MOD+d

Programmer Dvorak e is located same as QWERTY d, I guess sowm listens to key press on keys in specific location (of QWERTY) instead of the key in current keyboard layout.

2bwm has the same issue, dwm works fine.

dashezup commented 3 years ago

with Programmer Dvorak keyboard layout

  1. press MOD+Return to open a new terminal
  2. release Return but don't release MOD
  3. press d will run dmenu
  4. release MOD and d, press MOD+d won't do anything

I had the same problem with 2bwm, and with 2bwm after press some key all keybindings could work properly (happens very rare, I can't reproduce).

idk where to report the bug if it's not a WM but other libraries ones. Also idk if it's because of old packages, I use Void Linux, a few packages are a bit outdated.

dashezup commented 3 years ago

Turns out it's because sowm does not re-grab keys after keymap changes.

I have XkbVariant set in Xorg conf, so my ~/.xinitrc is mostly just exec sowm.

This is probably how this problem happened: before exec sowm, the keymap is still QWERTY, after sowm was launched and read the QWERTY keymap, the keymap changes to Programmer Dvorak according Xorg conf.

The temporary solution is run sleep 1 or better to setxkbmap us dvp to make sure the keymap is loaded before exec sowm in xinitrc.

The similar issue with 2bwm is fixed now, I've tried and it works flawlessly. https://github.com/venam/2bwm/commit/148d83254ca5f0fbc464ced5c487103aaf959559

So I think sowm could also solve this the same way.