Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong key events when Num Lock is active #3587

Closed
klpn opened this issue May 6, 2021 · 7 comments
Closed

Wrong key events when Num Lock is active #3587

klpn opened this issue May 6, 2021 · 7 comments
Labels

Comments

@klpn
Copy link

klpn commented May 6, 2021

If Num Lock is active, key events like Num Lock+<key> are generated when e.g. arrow keys are pressed.

To Reproduce
Steps to reproduce the behavior:

  1. Run kitty +kitten key_demo with Num Lock activated.
  2. Press and release left key (not on the numeric keypad). This gives the output.
NumLock+LEFT PRESS 
CSI 1 ; 129 D
NumLock+LEFT RELEASE 
CSI 1 ; 129 : 3 D

Expected behavior
Should generate an event pair like

LEFT PRESS 
CSI  D
LEFT RELEASE 
CSI  ; 1 : 3 D

The significance of the problem is that I cannot use the arrow keys to navigate in the Unicode Input kitten's name mode when Num Lock is active. They work fine when Num Lock is not active.

Environment details
OS: Arch Linux

$ kitty --debug-config
kitty 0.20.2 created by Kovid Goyal
Linux karl-ThinkPad-T580 5.11.16-arch1-1 #1 SMP PREEMPT Wed, 21 Apr 2021 17:22:13 +0000 x86_64
Arch Linux \r (\l)
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"
Loaded config files: /home/karl/.config/kitty/kitty.conf
Running under: X11

Config options different from defaults:
background            Color(red=255, green=255, blue=234)
font_size             12.0
foreground            Color(red=0, green=0, blue=0)
update_check_interval 24.0
url_prefixes          ('http', 'https', 'file', 'ftp')

Additional context
The problem can be reproduced with kitty --config NONE

@atimeofday
Copy link

I am having this issue. I know this is an odd use case, but it interferes with a custom binding on Backspace / Ctrl+Backspace input.

kitty 0.36.2
Fedora Silverblue 40 (bazzite-gnome-nvidia)
Wayland

Please let me know if more information is needed, or ideally, if there is already a simple kitty.conf toggle for numlock applying to non-numerical inputs - I have not been able to find one.

@kovidgoyal
Copy link
Owner

Numlock is not used/active in kitty keybindings. This issue was about the unicode input kitten and has already been fixed long ago.

@atimeofday
Copy link

Ah, sorry, the 'custom binding' I mentioned was for ble.sh running in kitty, not a kitty keybind. The binding functions in other terminals regardless of numlock, and in kitty when numlock is turned off, but does not function in kitty while numlock is active.

Until now I had not known/understood that kitty has 'kittens' or that there is one for unicode character input. Now that I do - I think my issue is different because it affects all command-line text input in kitty. Should I create a new issue for it?

image

@kovidgoyal
Copy link
Owner

You need to report the issue to ble.sh, not kitty. Presumably it is not
handling the numlock and capslock bits in the modifier for key events.

@atimeofday
Copy link

As per my last comment, this issue is unique to kitty, and I have been using ble.sh without the issue for years. It generally handles numlock and capslock like text editors do.

However, upon further research, I was able to find several ble.sh settings for handling quirks of kitty, and one of them solved my issue:

https://github.com/akinomyoga/ble.sh/blob/32f290df78554e22d7ff779d34f1dfec271c16df/blerc.template#L409

Thank you for your input.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Oct 6, 2024 via email

@akinomyoga
Copy link
Contributor

Which ble.sh apparently turns on

Yes, ble.sh turns on it.

and then doesn't parse correctly.

Could you provide the steps to reproduce this? As far as I test it with kitty 0.31.0 and 0.36.4, ble.sh correctly parses those bits in CSI sequences and correctly ignores them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants