-
Notifications
You must be signed in to change notification settings - Fork 173
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
Mapping multiple keys to an action #111
Comments
This strikes me as pathological behaviour :P. With some ingenuity (read: atrocious kludge) you might be able to tame it E.G
note that this will break if you want to assign leftcontrol to something other If you are lucky it may also be possible to change the emitted keycode using |
me too :)
That would be great, but i don't think this keyboard has a programmable firmware. Thanks for the suggested approach! I try it as this: [control]
leftshift = layer(control_shift)
[control_shift]
leftalt = layer(control_shift_alt)
[control_shift_alt]
leftmeta = layer(meta) ... but the
I slightly modified the configuration: [main]
leftcontrol = layer(mycontrol)
[mycontrol]
leftshift = layer(control_shift)
[control_shift]
leftalt = layer(control_shift_alt)
[control_shift_alt]
leftmeta = layer(meta) ... but I lost the left control as expected (e.g. Also I try leverage |
This should be
The modifiers at the end (e.g |
I should clarify that the config I provided will still depress
Should produce something like the following:
Note that won't work if you assign leftmeta to a modifier layer like E.G
This also means it won't combine properly with other modifers, but there are inevitably going to be some tradeoffs. |
Probably I was too abstract in the issue title: The closest config which I can to invent is: [main]
leftcontrol = layer(mycontrol)
[mycontrol]
leftshift = layer(control_shift)
[control_shift]
leftalt = layer(control_shift_alt)
[control_shift_alt]
leftmeta = layer(meta) ... but at the cost of left control lack. I have also tried I have no idea is this possible at all or possible with |
This config will completely break leftcontrol. It shouldn't be necessary to this. The config I provided should preserve leftcontrol and allow you to use the key which generates multiple keycodes as meta (with some caveats). E.G
What specific problem are you encountering?
The example config I provided should mostly work, though I can't test it. |
When I pressed "fakemeta" with the tab key, GNOME windows switching overlay blinked for a moment and with some chance switch the window. I thrown away that config and kept experimenting. Sorry, I can't reproduce that config now.
The config: [fakemeta]
a = M-a
b = M-b
[control]
leftshift = layer(control_shift)
[control_shift:C-S]
leftalt = layer(control_shift_alt)
[control_shift_alt:C-S-A]
leftmeta = layer(fakemeta) ... produces:
... when I press the "office key". This behavior is not differ from standard behavour without any config:
Moreover any hitting (without any modifiers) to the "A" (or "B") key produces:
I think it can be tested on any standard keyboard by pressing |
You didn't specify what key combination you are using to produce this. I assume it is the microsoft office key + a. You should be seeing something like:
Did you check the log output for errors? (
Yes, something appears to be wrong with your config. I just tested this and it worked as expected. |
I just tried copying and pasting the config I suggested, it seems some additional spaces were added at the end of the lines which may be causing your problem (you can confirm this in your system journal). I've also pushed a patch to automatically ignore empty space at the end of lines in the latest version. |
Yes, it is my case) Thank you! I have tryed this config: [fakemeta]
` = M-`
tab = M-tab
space = M-space
[control]
leftshift = layer(control_shift)
[control_shift:C-S]
leftalt = layer(control_shift_alt)
[control_shift_alt:C-S-A]
leftmeta = layer(fakemeta) It is very close to what I want to achieve, but it is still doesn't cover all use cases. As I said earlier, I was hoping to use office key as meta for windows switching. It does the trick for "one hit" case (e.g. just hit
I believe that the ideal behavior is:
Is it possible to get close to this behavior? Currently I'm happy with an alternative key mapping that doesn't invlove the "office" key at all. |
Yes, this is one of the caveats I alluded to. Another problem is that you won't be able to combine it with other modifier keys (e.g
You can achieve something close with This may or may not be a problem for you. It is only an issue if you are in the habit of holding E.G
This has the additional advantage of working in combination with other modifier keys. Note that for the this to work you will need the latest version. I have just released a patch which allows for swap actions to be nested.
You are running up against the limit of sequence based detection logic. The only way to mitigate this problem is to add an additional timeout to disambiguate the real control key from the synthetic event (since they are otherwise indisguishable). In this case you would need something which activates a layer only if another key is struck within a certain time interval. This is currently the opposite of how #81 is tangentially related. |
Did you ever get this working? The last config should have come quite close. |
I think I found a bug not related to the keyboard. (Tell me if you need to create a new task) If you press a modifier key and then immediately press the same modifier on the other side, then releasing one of them turns off the mode.
|
@andrey-shigantsov This is expected behaviour and has been addressed in #85. Feel free to post there if it is actually causing you grief :P. |
Yes! It's works as I expect in my GNOME environment: "office" key is felt as meta key. My full config is: [ids]
*
[main]
capslock = esc
esc = capslock
rightalt = layer(alt)
[control]
leftshift = swap(control_shift)
[control_shift:C-S]
leftalt = swap(control_shift_alt)
[control_shift_alt:C-S-A]
leftmeta = swap(meta) I feel fully comfortable with it in GNOME. |
Thanks for closing the loop :). I am going to close this for now. |
The new timeout functionality might be a better way to solve this. Something like this should do the trick:
You may have to increase the timeout values, depending on how fast the keyboard emits successive events, but the end result should be fairly reliable since the threshold will probably be well below what you can achieve manually. |
Thanks! It works like a charm!
PS I will test more) |
I have Microsoft Ergonomic Keyboard. It's a good keyboard, but contains two strange and useless keys between right alt and right control: "microsoft office" and "smile".
(photo from microsoft.com).
When the "microsoft office" key is pressed it produces four keys: control, shift, alt and meta.
When the "smile" key is pressed it produces five keys, like "microsoft office" but with additional space key.
I just want to bind "microsoft office" to meta, with something like this:
Can I achive this in the current version? E.g. with some layer configuration. Is there a more direct way to do this planned in future releases?
The text was updated successfully, but these errors were encountered: