-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support logical modifier keys #124
Comments
One workaround that seems already possible is: modmap:
CapsLock: Alt_R
Alt_R: Alt_L
keymap:
Alt_R-i: Up
Alt_R-j: Left
Alt_R-k: Down
Alt_R-l: Right
Alt_R-o: End
Alt_R-u: Home
Alt_R-p: PageUp
Alt_R-Semicolon: PageDown where physical Alt_R and Alt_L are used as actual Alt as Alt_L and virtual Alt_R is used as an extra modifier. If the above workaround works for you, please do. However, I understand that it's just a workaround and it makes configuration hard. As somebody else also mentioned the necessity of a virtual modifier when he tried xremap, I plan to have an official implementation for it in the future. But I have an in-progress development for another OSS and I'd like to work on the feature after it. So I need you to use a workaround for now. |
Firstly thank you for your good work. :) As for that workaround it remaps my Alt_R which i use for pressing Alt_R + a = ä for example, so it doesn't work for me that well. I ended up with the best workaround so far if someone needs that (i had to disable win(super) key to open application menu in KDE Plasma [like this] to use caps lock as super): modmap:
- name: Global
remap:
CapsLock:
alone: Esc
held: Super_L
keymap:
- name: Global
remap:
# ijkl -> Arrow keys
Super_L-I: Up
Super_L-J: Left
Super_L-K: Down
Super_L-L: Right
Shift-Super_L-I: Shift-Up
Shift-Super_L-J: Shift-Left
Shift-Super_L-K: Shift-Down
Shift-Super_L-L: Shift-Right
Alt_L-Super_L-I: Alt_L-Up
Alt_L-Super_L-J: Alt_L-Left
Alt_L-Super_L-K: Alt_L-Down
Alt_L-Super_L-L: Alt_L-Right
Shift-Alt_L-Super_L-I: Shift-Alt_L-Up
Shift-Alt_L-Super_L-J: Shift-Alt_L-Left
Shift-Alt_L-Super_L-K: Shift-Alt_L-Down
Shift-Alt_L-Super_L-L: Shift-Alt_L-Right
Ctrl-Super_L-I: Ctrl-Up
Ctrl-Super_L-J: Ctrl-Left
Ctrl-Super_L-K: Ctrl-Down
Ctrl-Super_L-L: Ctrl-Right
Shift-Ctrl-Super_L-I: Shift-Ctrl-Up
Shift-Ctrl-Super_L-J: Shift-Ctrl-Left
Shift-Ctrl-Super_L-K: Shift-Ctrl-Down
Shift-Ctrl-Super_L-L: Shift-Ctrl-Right
##########################################
# uop; -> Home End PageUp PageDown
Super_L-U: Home
Super_L-O: End
Super_L-P: PageUp
Super_L-SEMICOLON: PageDown
Shift-Super_L-U: Shift-Home
Shift-Super_L-O: Shift-End
Shift-Super_L-P: Shift-PageUp
Shift-Super_L-SEMICOLON: Shift-PageDown
Ctrl-Super_L-U: Ctrl-Home
Ctrl-Super_L-O: Ctrl-End
Ctrl-Super_L-P: Ctrl-PageUp
Ctrl-Super_L-SEMICOLON: Ctrl-PageDown
Shift-Ctrl-Super_L-U: Shift-Ctrl-Home
Shift-Ctrl-Super_L-O: Shift-Ctrl-End
Shift-Ctrl-Super_L-P: Shift-Ctrl-PageUp
Shift-Ctrl-Super_L-SEMICOLON: Shift-Ctrl-PageDown As you see i had to add all the necessary extra modifiers for editing, since without them if i Super_L-I: Up
Super_L-J: Left
Super_L-K: Down
Super_L-L: Right without the need to add all the clutter modifiers? Another last question: is it possible in modmap:
remap:
Super_L: Alt_R-F1 # <<<<<<< which will then act as a macro maybe. It would be a good feature to add a macro kindof system. |
What's your expected behavior for that case? Just output
Sending a key combination is for modmap:
- remap:
Super_L: Muhenkan
keymap:
- remap:
Muhenkan: Alt-F1 |
In the workaround you gave me i can access the german layer only with
Great that works! |
I read your explanation, but it feels inexhaustive and I didn't get why my suggestion doesn't work for you. Can you just describe expected input and output key combinations? For example,
I believe #124 (comment) works like the above, so you can still output ü using actual Alt_R or Alt_L as if nothing happened to Alt and CapsLock works like an extra modifier. |
Sorry for my bad explaination.
For better clarification the (EurKey) layout provides the european letters using the (Alt_Gr)Alt_R+[letter]. Better shown how it works in this picture from the website: I need to be able to:
I hope this time it is clear. |
My idea should be still applicable (though I haven't actually tested it) even if you want to output Alt_R instead of Alt_L for some reason, e.g. modmap:
CapsLock: Alt_L
Alt_L: Alt_R # optional for what you described
keymap:
Alt_L-i: Up
Alt_L-j: Left
Alt_L-k: Down
Alt_L-l: Right
Alt_L-o: End
Alt_L-u: Home
Alt_L-p: PageUp
Alt_L-Semicolon: PageDown I expect this config to generate what you described. |
It does work but this time i have other issues:
What also should work is: (shift/alt/ctrl/shift-alt/ctrl-shift)-Capslock-(i/j/k/l) to work as expected as if im using normal arrows. |
What i managed to do is this config which should be the best solution with Super_R but it has a weird behaviour: modmap:
- name: Global
remap:
CapsLock:
alone: Esc
held: Super_R
keymap:
- name: Global
remap:
##########################################
# CapsLock ijkl -> Arrow keys
Super_R-I: Up
Super_R-J: Left
Super_R-K: Down
Super_R-L: Right
Shift-Super_R-I: Shift-Up
Shift-Super_R-J: Shift-Left
Shift-Super_R-K: Shift-Down
Shift-Super_R-L: Shift-Right
Alt_L-Super_R-I: Alt_L-Up
Alt_L-Super_R-J: Alt_L-Left
Alt_L-Super_R-K: Alt_L-Down
Alt_L-Super_R-L: Alt_L-Right
Shift-Alt_L-Super_R-I: Shift-Alt_L-Up
Shift-Alt_L-Super_R-J: Shift-Alt_L-Left
Shift-Alt_L-Super_R-K: Shift-Alt_L-Down
Shift-Alt_L-Super_R-L: Shift-Alt_L-Right
Ctrl-Super_R-I: Ctrl-Up
Ctrl-Super_R-J: Ctrl-Left
Ctrl-Super_R-K: Ctrl-Down
Ctrl-Super_R-L: Ctrl-Right
Shift-Ctrl-Super_R-I: Shift-Ctrl-Up
Shift-Ctrl-Super_R-J: Shift-Ctrl-Left
Shift-Ctrl-Super_R-K: Shift-Ctrl-Down
Shift-Ctrl-Super_R-L: Shift-Ctrl-Right
##########################################
# CapsLock + uop; -> Home End PageUp PageDown
Super_R-U: Home
Super_R-O: End
Super_R-P: PageUp
Super_R-SEMICOLON: PageDown
Shift-Super_R-U: Shift-Home
Shift-Super_R-O: Shift-End
Shift-Super_R-P: Shift-PageUp
Shift-Super_R-SEMICOLON: Shift-PageDown
Ctrl-Super_R-U: Ctrl-Home
Ctrl-Super_R-O: Ctrl-End
Ctrl-Super_R-P: Ctrl-PageUp
Ctrl-Super_R-SEMICOLON: Ctrl-PageDown
Shift-Ctrl-Super_R-U: Shift-Ctrl-Home
Shift-Ctrl-Super_R-O: Shift-Ctrl-End
Shift-Ctrl-Super_R-P: Shift-Ctrl-PageUp
Shift-Ctrl-Super_R-SEMICOLON: Shift-Ctrl-PageDown
##########################################
# CapsLock + BackSpace -> Delete
Super_R-BackSpace: Delete
Shift-Super_R-BackSpace: Shift-Delete
Ctrl-Super_R-BackSpace: Ctrl-Delete If i press: Caps_Lock+j,i,k,l or other combination, it sends the right keys but at the same time it sends also Super_R(R win) which opens the application menu as show in the video: What i simply do is pressing Caps_Lock + j 2022-07-04.19-12-09.mp4I suspect that it has something to do with how it sends out the keys as i see it sends rightmeta 1 then 0 means it presses and releases right after i press j as shown in the debug. |
Thanks. This explains everything I wanted to know about my suggestion.
Right, I think it's the same thing as #102. I'll work on those once what I'm currently working on is finished.
This seems intentional. When you remap Super_R+j to Left and Left is emitted, it has to release Super_R because otherwise it would be Super_R+Left. If you want to keep holding Super_R, then you could remap Super_R+j to Super_R+Left. To simply fix this problem by just not using Super_R, please wait until I get time to work on virtual modifiers. |
Thank you a lot for your time and effort you put into helping and good luck for your work. Ofcourse i will wait for that. I come along with one of the solutions for now. |
Update: As I'm currently focusing on a big change for another OSS, I'm planning to work on this issue on Aug 13th. If I receive a pull request before that, I can take a look at that too. |
It would be really great if the problem fixed. |
Can you show the output of I'd also appreciate your code or command to use xkb for making ISO_Level3_SHIFT work. |
I think if I'm not mistaken this won't work with |
Thanks. I might support keyboard layout features in the future, but to know my knowledge, xkb is an X-specific interface, so we need to investigate how to make that work for Wayland. Meanwhile, you may emit a key event that corresponds to ISO_Level3_SHIFT with xremap and then anything beyond that is for another layer on top of it. |
Released #146 in v0.6.1. |
Nice. Thanks for your work! Tapping it doesn't do anything as intended but when pressing the combinations in |
when adjusting modifiers on KeyPress addresses #124 (comment)
Thanks for the report and for sponsoring me :) I fixed the issue in v0.6.2. |
You are welcome, i have to thank you for your great work in this project and others as well! Works now. Unfortunately binding |
Sorry, can you share your current config? I'm a bit confused now. |
modmap:
- name: Global
remap:
CapsLock:
modifier: true
alone: Esc
keymap:
- name: Global
remap:
CapsLock-i: Up
CapsLock-j: Left
CapsLock-k: Down
CapsLock-l: Right
CapsLock-o: End
CapsLock-u: Home
CapsLock-p: PageUp
CapsLock-SemiColon: PageDown Simply what i want to do is while holding be a modifier and tapping alone |
OK, I wasn't aware that you could parse I changed it. |
I understand. |
Hello,
I'm trying to map capslock + ijkl keys to arrow keys and extra: o -> end, u -> home, p -> pageup, ; -> pagedown.
The mapping should be compatible with (shift, alt, ctrl, shift+ctrl and shift+alt) + Arrow for editing in vscode for example.
What i tried:
In xmodmap i used to use mode_switch which works fine with win key:
Is there maybe an extra layer of modifier i didn't find? Any suggestions on how i can do it?
This is a common used mapping navigation. Would appreciate anyones help. :)
Extra: xremap ❤ Rust
The text was updated successfully, but these errors were encountered: