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

BUG: numeric keypad no longer writes keys anymore #702

Open
wiiznokes opened this issue Nov 10, 2024 · 7 comments
Open

BUG: numeric keypad no longer writes keys anymore #702

wiiznokes opened this issue Nov 10, 2024 · 7 comments
Milestone

Comments

@wiiznokes
Copy link
Contributor

I can write numbers in text inputs while holding shift + & for example, but the keypad no longer works (since some time now)

@tg90nor
Copy link

tg90nor commented Nov 25, 2024

I have this issue too. Regardless of numlock state pressing numpad keys results in them functioning as arrow keys. Curiously the number 5 on the numpad works correctly.

@tsimoes79
Copy link

i'm experiencing the same issue. I installed numlockx and its status respect the keyboard leds. If numlock led is on, which means that I manually enable Numlock, it returns ON. The other way around works fine too.
But, mainly in the terminal, it works as arrows except number 5.
Absolutely the same problem.

@snyluc13
Copy link

Same issue here with wired reddragon keyboard

@Nashenas88
Copy link

I bisected this on cosmic-term and found it's between commits 100f75f and 47ba123. I'm still trying to narrow down further.

@Nashenas88
Copy link

I tracked it down to commit 0491c4b which also includes an update to iced. iced was updated from pop-os/iced@0619950 to pop-os/iced@f2f9dfc. Unfortunately, there's ~42,000 lines changed between those two versions. I think it has something to do with the update to using winit events for the key events, but still not clear.

@Nashenas88
Copy link

Nashenas88 commented Jan 8, 2025

After digging further it seems that the libcosmic update broke backwards compatibility and apps need to be updated. The value that used to be relied on, key, was moved to modified_key. Now the key value represents the typical value of the keyboard key without any modifiers. So when pressing on a numpad key now, you'll get the following structs:

[2025-01-08T06:46:02Z WARN  cosmic_term::terminal_box] got KeyPressed { key: Named(ArrowLeft), modified_key: Character("4"), physical_key: Code(Numpad4), location: Numpad, modifiers: Modifiers(0x0), text: Some("4") }
[2025-01-08T06:46:06Z WARN  cosmic_term::terminal_box] got KeyPressed { key: Named(ArrowRight), modified_key: Character("6"), physical_key: Code(Numpad6), location: Numpad, modifiers: Modifiers(0x0), text: Some("6") }

cosmic-term and other apps were written to only look at key, and were not updated when modified_key was added and the behavior changed.

I found a simple workaround that I think works for cosmic-term by just checking whether the named_key == modified_key, but I'm not sure if that will work for every other app.

@Quackdoc
Copy link

Quackdoc commented Jan 9, 2025

cosmic-edit is effected as well.

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

No branches or pull requests

7 participants