avahe-kellenberger / nimdow

A window manager written in Nim (In Development)
GNU General Public License v2.0
317 stars 19 forks source link

Cannot move/resize windows if NumLock or CapsLock is enabled #208

Closed avahe-kellenberger closed 1 year ago

avahe-kellenberger commented 1 year ago

Read https://tronche.com/gui/x/xlib/events/keyboard-pointer/keyboard-pointer.html

The state member is set to indicate the logical state of the pointer buttons and modifier keys just prior to the event,
which is the bitwise inclusive OR of one or more of the button or modifier key masks:
Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, ShiftMask,
LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask.

If LockMask is or'd into the XKeyEvent state, moving or resizing won't work. We need to filter them out of the event's state in order to ignore it (see dwm's implementation)