libcosmic: BUG: numeric keypad no longer writes keys anymore

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 7
  • Comments: 15

Most upvoted comments

Hi, This issue is closed but I still cannot use the numpad in COSMIC Text Editor ? Thanks

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.