conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.34k stars 97 forks source link

Alt key not recognized as a keybinding on german keyboard #476

Closed Schweber closed 1 year ago

Schweber commented 3 years ago

I am using a german keyboard and am not able to use the Alt key as a key binding for spectrwm.

According to xev my Alt key is named "Alt_L". Neither that, nor Mod1, Mod2 or Mod3 is recognized by spectrwm when i press the Alt key on my keyboard.

If i define e.g. "Alt+x" as a keybinding, then spectrwm shows an error because Alt is not an allowed key. When i define e.g. "Alt_L+x" instead, then no error is shown, however it still doesn't work.

MOD is set to Mod4 and works, so my Windows/Super key is recognized as Mod4 and all keybindings with MOD work.

I am using spectrwm 3.4.1-1 on Manjaro 5.14.10-1 kernel.

What can i do to fix this issue?

LordReg commented 3 years ago

Try explicitly setting your layout at runtime before spectrwm starts:

setxkbmap de
exec spectrwm

See https://github.com/conformal/spectrwm/issues/310#issuecomment-621158723

mschilli87 commented 3 years ago

@LordReg: What if I use several layouts switching back and forth depending on the language/alphabet I need for the job at hand? Do I need to restart spectrwm every time I switch (or switch back to the 'main'/initial layout before using keybindings) or would specifying all layouts (comma-separated) via setxkbmap suffice?

LordReg commented 3 years ago

@mschilli87 spectrwm binds keycodes based on the keymap at the time it starts. If you set multiple layouts via setxkbmap, spectrwm will search each layout in the specified order to determine which keycodes to grab for each bind. If you switch layouts after spectrwm starts, the physical key combinations do not change.

Schweber commented 3 years ago

Thank you for your help

  1. Okt. 2021, 23:28 von @.***:

Try explicitly setting your layout at runtime before spectrwm starts:

setxkbmap deexec spectrwm

See > #310 (comment) https://github.com/conformal/spectrwm/issues/310#issuecomment-621158723

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/conformal/spectrwm/issues/476#issuecomment-942734958> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/APNC5T22R4W3JGOQQRGJGALUGX2YBANCNFSM5FUBU5ZA> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .