waycrate / swhkd

Sxhkd clone for Wayland (works on TTY and X11 too)
https://git.sr.ht/~shinyzenith/swhkd
BSD 2-Clause "Simplified" License
679 stars 47 forks source link

[feat] Add `leftsuper` and `rightsuper` Keys #214

Closed trueNAHO closed 12 months ago

trueNAHO commented 1 year ago

Motivation

Towards a more ergonomic working environment. This PR enables the use of the super key as a keysym.

Help Needed

All tests successfully pass:

$ make test
test result: ok. 51 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

     Running unittests src/main.rs (target/debug/deps/swhks-328709fb84de0909)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

However, the added unit test does not seem to work as expected when added to $HOME/.config/swhkd/swhkdrc:

leftsuper
    konsole

rightsuper
    qutebrowser

Possibly, the key listener is unable to distinguish between config::Modifier::Super and Key::KEY_LEFTMETA or Key::KEY_RIGHTMETA key presses because both Key::KEY_LEFTMETA and Key::KEY_RIGHTMETA keys are mapped to the same config::Modifier::Super modifier:

let modifiers_map: HashMap<Key, config::Modifier> = HashMap::from([
    (Key::KEY_LEFTMETA, config::Modifier::Super),
    (Key::KEY_RIGHTMETA, config::Modifier::Super),
]);

Since I am unfamiliar with Rust, I believe it would be appropriate for someone with Rust experience to handle this situation.

Closes Issue

Related Issues

Heavily Inspired By

obvionaoe commented 1 year ago

What's blocking this PR?

Shinyzenith commented 1 year ago

I believe this pr is incomplete if memory serves me correctly.

Shinyzenith commented 1 year ago

Feel free to finish up on the work

trueNAHO commented 12 months ago

Apologies for the confusion and delay in my response. This PR was meant as a starting point, but I can't finish it myself:

Since I am unfamiliar with Rust, I believe it would be appropriate for someone with Rust experience to handle this situation.

I should have opened an issue instead of submitting an incomplete PR. Feel free to take over and initiate a new one.