ii8 / havoc

minimal terminal emulator for wayland
Other
103 stars 17 forks source link

suppress events for more modifier keys #15

Closed thejh closed 4 years ago

thejh commented 4 years ago

kbd_key() already suppresses events for various modifier keys; but with the neo2 layout, some of them still go through, causing e.g. the cursor in nano to jump a line down or causing vi to leave insert mode when I press the level3 shift key in order to enter characters like brackets.

Add the missing modifier keys that I've noticed.

ii8 commented 4 years ago

This is a bit of a hack at the moment.

xkb_keysym_to_utf32 returns 0 for keysyms that don't translate to unicode. But tsm-vte uses TSM_VTE_INVALID(not 0) to denote an invalid unicode input.

So I think a better way to fix this would be to set unicode to TSM_VTE_INVALID whenever it's 0, tsm will then ignore it. That should work for all possible layouts and we won't need the hardcoded switch anymore.

ii8 commented 4 years ago

I've fixed this in a way that should work for all possible layouts in b09b1420ca67fe1cfb032abf4e39b2943c244f10

Let me know if that works for you.

thejh commented 4 years ago

Yeah, that works. Thanks!