keybindings: Use a less hacky method of getting the proper modifier mask

This is the method Ran suggests as a workaround in
https://github.com/xkbcommon/libxkbcommon/pull/10