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

Considering supporting numpadinsert and numpaddelete for bindings in Linux #770

Open
cppHusky opened this issue Nov 12, 2024 · 9 comments
Open

Comments

@cppHusky
Copy link

I used to press control + numpad insert for copy and shift + numpad insert for paste, but I noticed that in Linux the insert and numpad insert are not equal.

In my experience, many applications in linux support both insert and numpad insert (e.g. chrome, vscode). Some others regard numpad insert as Num + Insert (e.g. KDE system settings and Konsole). But it seems that Rio doesn't directly support numpadinsert according to the doc

Additionally, rio do not support numpaddelete, too. I think it's necessary to support them.

@raphamorim
Copy link
Owner

Hey @cppHusky thank you for the issue!

is this something you would like to contribute? I can help with it along the way

@cppHusky
Copy link
Author

Hey @cppHusky thank you for the issue!

is this something you would like to contribute? I can help with it along the way

Err... I was a newbie in Rust, but I would like to have a try.

If successful, I will make a PR.

@raphamorim
Copy link
Owner

No stress, feel free to join our discord and reach out. https://discord.gg/zRvJjmKGwS

This is the file that needs to be changed

// Special case numpad.
"numpadenter" => (Key::Named(Enter), KeyLocation::Numpad),
"numpadadd" => (Key::Character("+".into()), KeyLocation::Numpad),
"numpadcomma" => (Key::Character(",".into()), KeyLocation::Numpad),
"numpaddecimal" => (Key::Character(".".into()), KeyLocation::Numpad),
"numpaddivide" => (Key::Character("/".into()), KeyLocation::Numpad),
"numpadequals" => (Key::Character("=".into()), KeyLocation::Numpad),
"numpadsubtract" => (Key::Character("-".into()), KeyLocation::Numpad),
"numpadmultiply" => (Key::Character("*".into()), KeyLocation::Numpad),
"numpad1" => (Key::Character("1".into()), KeyLocation::Numpad),
"numpad2" => (Key::Character("2".into()), KeyLocation::Numpad),
"numpad3" => (Key::Character("3".into()), KeyLocation::Numpad),
"numpad4" => (Key::Character("4".into()), KeyLocation::Numpad),
"numpad5" => (Key::Character("5".into()), KeyLocation::Numpad),
"numpad6" => (Key::Character("6".into()), KeyLocation::Numpad),
"numpad7" => (Key::Character("7".into()), KeyLocation::Numpad),
"numpad8" => (Key::Character("8".into()), KeyLocation::Numpad),
"numpad9" => (Key::Character("9".into()), KeyLocation::Numpad),
"numpad0" => (Key::Character("0".into()), KeyLocation::Numpad),

(need to add numpadinsert and numpaddelete

@cppHusky
Copy link
Author

No stress, feel free to join our discord and reach out. https://discord.gg/zRvJjmKGwS

This is the file that needs to be changed

// Special case numpad.
"numpadenter" => (Key::Named(Enter), KeyLocation::Numpad),
"numpadadd" => (Key::Character("+".into()), KeyLocation::Numpad),
"numpadcomma" => (Key::Character(",".into()), KeyLocation::Numpad),
"numpaddecimal" => (Key::Character(".".into()), KeyLocation::Numpad),
"numpaddivide" => (Key::Character("/".into()), KeyLocation::Numpad),
"numpadequals" => (Key::Character("=".into()), KeyLocation::Numpad),
"numpadsubtract" => (Key::Character("-".into()), KeyLocation::Numpad),
"numpadmultiply" => (Key::Character("*".into()), KeyLocation::Numpad),
"numpad1" => (Key::Character("1".into()), KeyLocation::Numpad),
"numpad2" => (Key::Character("2".into()), KeyLocation::Numpad),
"numpad3" => (Key::Character("3".into()), KeyLocation::Numpad),
"numpad4" => (Key::Character("4".into()), KeyLocation::Numpad),
"numpad5" => (Key::Character("5".into()), KeyLocation::Numpad),
"numpad6" => (Key::Character("6".into()), KeyLocation::Numpad),
"numpad7" => (Key::Character("7".into()), KeyLocation::Numpad),
"numpad8" => (Key::Character("8".into()), KeyLocation::Numpad),
"numpad9" => (Key::Character("9".into()), KeyLocation::Numpad),
"numpad0" => (Key::Character("0".into()), KeyLocation::Numpad),

(need to add numpadinsert and numpaddelete

Thanks!

@cppHusky
Copy link
Author

cppHusky commented Nov 13, 2024

No stress, feel free to join our discord and reach out. https://discord.gg/zRvJjmKGwS

This is the file that needs to be changed

// Special case numpad.
"numpadenter" => (Key::Named(Enter), KeyLocation::Numpad),
"numpadadd" => (Key::Character("+".into()), KeyLocation::Numpad),
"numpadcomma" => (Key::Character(",".into()), KeyLocation::Numpad),
"numpaddecimal" => (Key::Character(".".into()), KeyLocation::Numpad),
"numpaddivide" => (Key::Character("/".into()), KeyLocation::Numpad),
"numpadequals" => (Key::Character("=".into()), KeyLocation::Numpad),
"numpadsubtract" => (Key::Character("-".into()), KeyLocation::Numpad),
"numpadmultiply" => (Key::Character("*".into()), KeyLocation::Numpad),
"numpad1" => (Key::Character("1".into()), KeyLocation::Numpad),
"numpad2" => (Key::Character("2".into()), KeyLocation::Numpad),
"numpad3" => (Key::Character("3".into()), KeyLocation::Numpad),
"numpad4" => (Key::Character("4".into()), KeyLocation::Numpad),
"numpad5" => (Key::Character("5".into()), KeyLocation::Numpad),
"numpad6" => (Key::Character("6".into()), KeyLocation::Numpad),
"numpad7" => (Key::Character("7".into()), KeyLocation::Numpad),
"numpad8" => (Key::Character("8".into()), KeyLocation::Numpad),
"numpad9" => (Key::Character("9".into()), KeyLocation::Numpad),
"numpad0" => (Key::Character("0".into()), KeyLocation::Numpad),

(need to add numpadinsert and numpaddelete

Emmm... Things may be more complicated than I think...

It seems that All of numpad 0-9 keys can't be bound correctly.

I've tested the following config on Windows and Linux:

[bindings]
keys=[
  { key = "numpad5", with = "control", action = "Paste" }, # failed
  { key = "5", with = "control", action = "Paste" }, # successful
  { key = "numpadadd", with = "control", action = "Paste" }, # successful
]

When I tried to paste with control + 5 or control + numpadadd, I could get the pasted content.

But whether I enable numlock or not, it didn't paste anything with control + numpad5.

I think the problem could be about winit but not completely sure.

@raphamorim
Copy link
Owner

Yea, it looks this problem is a bit more complex than I originally thought

alacritty/alacritty#5901

Even alacritty doesn't have numpadinster and numpaddelete because of that

@cppHusky
Copy link
Author

cppHusky commented Nov 15, 2024

Emmm... Things may be more complicated than I think...

It seems that All of numpad 0-9 keys can't be bound correctly.

I've tested the following config on Windows and Linux:

[bindings]
keys=[
  { key = "numpad5", with = "control", action = "Paste" }, # failed
  { key = "5", with = "control", action = "Paste" }, # successful
  { key = "numpadadd", with = "control", action = "Paste" }, # successful
]

When I tried to paste with control + 5 or control + numpadadd, I could get the pasted content.

But whether I enable numlock or not, it didn't paste anything with control + numpad5.

I think the problem could be about winit but not completely sure.

Correction: If I enable numlock I can paste with control+numpad[0-9], but if I disable numlock, I can't paste.

So maybe we need a method to detect numlock? After all, the numpad0 and numpadinsert correspond to same physical key.

@cppHusky
Copy link
Author

Yea, it looks this problem is a bit more complex than I originally thought

alacritty/alacritty#5901

Even alacritty doesn't have numpadinster and numpaddelete because of that

I've tried alacritty and found that it supports shift+numpadinsert regardless of whether numlock is enabled or not.

Alacritty also uses winit as a dependency, so it's not a winit problem.

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

No branches or pull requests

2 participants