kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.77k stars 959 forks source link

Incorrect key recognition with Input Remapper #6159

Closed korrmet closed 1 year ago

korrmet commented 1 year ago

Describe the bug I'm using Input Remapper to swap [Caps Lock] and right [Ctrl]. When I started Tmux in the Kitty terminal session I found that [Ctrl] + [B] completely doesn't work. Same thing happen when I started Vim, [Ctrl] + [W] doesn't work too. The [Ctrl] behavior normalized after I turn off keyboard remapping. Also I've tried to use left [Ctrl] key that was not remapped, and it's Ok.

Other applications works Ok while using remapper.

To Reproduce Preconditions:

  1. OS: Ubuntu MATE
  2. Input Remapper installed

Steps to reproduce the behavior:

  1. Configure the remapper to swap rignt [Ctrl] and [Caps Lock]
  2. Start Kitty
  3. Start tmux
  4. press physical keys: [Caps Lock] + [B], and after that [Shift] + ["]
  5. Instead of split terminal you will see entered " character
  6. press physical keys: [Caps Lock] + [D],
  7. Instead of leave terminal you will see that nothing happens.
  8. press physical keys: [Caps Lock] + [Shift] + [F6]
  9. Kitty prints the detail below.

Environment details

kitty 0.21.2 created by Kovid Goyal
Linux lnv 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64
Ubuntu 22.04.2 LTS \n \l
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
Running under:X11
Loaded config files:
  /etc/xdg/kitty/kitty.conf
  /home/art/.config/kitty/kitty.conf

Config options different from defaults:
background            Color(red=0, green=43, blue=54)
background_opacity    0.7
font_family           Iosevka Extended
font_size             9.0
foreground            Color(red=255, green=255, blue=255)
update_check_interval 0.0

Additional context Same behavior observed when 'kitty --config NONE'.

kovidgoyal commented 1 year ago

I have no idea what input remapper is. kitty recognizes keys on linux using libxkbcommon. I am fairly sure remapping of modifier keys is not supported. Relevant code is on glfw/xkb_glfw.c

If you wish to add support for whatever hackery input remapper does to remap modifiers patches are welcome, but its not something I am going to spend time on.

You can run kitty with --debug-input to see what input events it receives. And note that the kitty version you are running is very old I suggest updating to use the official binaries.

korrmet commented 1 year ago

Wow, you're fast :) Ok, I'll try. Thank you!