Comments (4)
I wouldn't expect it to work like that, but it wouldn't surprise me if it has been doing that all along, as my use cases always involve the main key and a modifier key, and it is typically harmless if the modifier continues to be reported.
I don't have a ton of bandwidth to investigate this, so I would value your effort to figure out what's going on and perhaps resolve it!
from evremap.
I'm experiencing a similar issue While doing further research, it turned out that my issue is unrelated. Keeping this for historic purposes.
[[dual_role]]
input = "KEY_CAPSLOCK"
hold = ["KEY_RIGHTMETA"]
tap = ["KEY_ESC"]
[[remap]]
input = ["KEY_LEFTMETA", "KEY_I"]
output = ["KEY_UP"]
[[remap]]
input = ["KEY_LEFTMETA", "KEY_J"]
output = ["KEY_LEFT"]
[[remap]]
input = ["KEY_LEFTMETA", "KEY_K"]
output = ["KEY_DOWN"]
[[remap]]
input = ["KEY_LEFTMETA", "KEY_L"]
output = ["KEY_RIGHT"]
When performing the following sequence:
- press META
- press J
- press L
- release J
- release L
- release META
...the following inputs are generated by evremap:
- LEFT
- L (exactly when J is released)
- RIGHT
from evremap.
Seems like the issue might be due to evremap releasing the modifier (META) once J is pressed. I've added some logs to debug this, here's the output of my previous key sequence:
2023-07-02T01:13:12.439 ERROR evremap::remapper > Press [KEY_RIGHTMETA]
2023-07-02T01:13:12.520 ERROR evremap::remapper > Press [KEY_LEFT]
2023-07-02T01:13:12.520 ERROR evremap::remapper > Release [KEY_RIGHTMETA]
2023-07-02T01:13:12.571 ERROR evremap::remapper > Press [KEY_L]
2023-07-02T01:13:12.614 ERROR evremap::remapper > Press [KEY_RIGHT]
2023-07-02T01:13:12.614 ERROR evremap::remapper > Release [KEY_LEFT, KEY_L]
2023-07-02T01:13:12.657 ERROR evremap::remapper > Press [KEY_RIGHTMETA]
2023-07-02T01:13:12.657 ERROR evremap::remapper > Release [KEY_RIGHT]
2023-07-02T01:13:12.723 ERROR evremap::remapper > Release [KEY_RIGHTMETA]
Here's the logs of me pressing META+J alone:
2023-07-02T01:14:21.745 ERROR evremap > Short delay: release any keys now!
2023-07-02T01:14:24.121 ERROR evremap::remapper > Going into read loop
2023-07-02T01:14:24.863 ERROR evremap::remapper > Press [KEY_RIGHTMETA]
2023-07-02T01:14:25.092 ERROR evremap::remapper > Press [KEY_LEFT]
2023-07-02T01:14:25.092 ERROR evremap::remapper > Release [KEY_RIGHTMETA] <---- fake release
2023-07-02T01:14:25.252 ERROR evremap::remapper > Press [KEY_RIGHTMETA] <---- followed by a press again
2023-07-02T01:14:25.252 ERROR evremap::remapper > Release [KEY_LEFT]
2023-07-02T01:14:25.580 ERROR evremap::remapper > Release [KEY_RIGHTMETA]
This also happens when I use a single-role modifier, e. g. CTRL or LEFTMETA.
EDIT: When I press META+J, desired_keys
becomes empty. I think this is what causes evremap to release the modifier. Inside compute_keys
, keys
still contain META & J during first phase, however they are removed during second phase. This seems like a tricky situation, since:
- It makes sense for
evremap
to releaseMETA
during substitution (to properly generate LEFT instead of META+LEFT), howeverevremap
needs to remember thatMETA
was pressed in order to generate proper remap for a second press while first press has not been released yet. - It seems like
evremap
sees META, J, & L pressed all together, and it substitutes META+J from the list, thus treating L as pressed without a modifier. This meansevremap
will probably need to differentiate between modifiers and non-modifier keys.
EDIT 2: I was able to resolve my issue with the following patch:
diff --git a/src/remapper.rs b/src/remapper.rs
index 0e90697..2965184 100644
--- a/src/remapper.rs
+++ b/src/remapper.rs
@@ -164,13 +164,17 @@ impl InputMapper {
if input.is_subset(&keys_minus_remapped) {
for i in input {
keys.remove(i);
- keys_minus_remapped.remove(i);
+ if !is_modifier(i) {
+ keys_minus_remapped.remove(i);
+ }
}
for o in output {
keys.insert(o.clone());
// Outputs that apply are not visible as
// inputs for later remap rules
- keys_minus_remapped.remove(o);
+ if !is_modifier(o) {
+ keys_minus_remapped.remove(o);
+ }
}
}
}
Not sure if there are any side effects to this, but this made my life much easier! The idea here is to allow modifier keys to be reused for multiple remaps, e. g. when keys that are pressed trigger multiple remaps with shared key, e. g. META+J+K -> META+J and META+K. Let me know what you think.
from evremap.
I'm still getting this behavior when trying to turn a trio of keys into arrow keys on a 60% keyboard.
[[remap]]
input = ["KEY_RIGHTALT"]
output = ["KEY_LEFT"]
[[remap]]
input = ["KEY_RIGHTCTRL"]
output = ["KEY_RIGHT"]
[[remap]]
input = ["KEY_COMPOSE", "KEY_RIGHTALT"]
output = ["KEY_UP"]
[[remap]]
input = ["KEY_COMPOSE", "KEY_RIGHTCTRL"]
output = ["KEY_DOWN"]
[[remap]]
input = ["KEY_COMPOSE"]
output = []
My goal is to use right alt and control as left and right, and also as up and down if I'm holding the compose key. It does work, but when doing the combinations I still get left and right inputs instead of just the up and down. I've tried it with the rules in various orders and the behavior is always the same.
from evremap.
Related Issues (20)
- works in tty, but not in compositor. HOT 3
- No way to access keys absent from keyboard HOT 1
- Feature request: Support waiting for keyboard to be connected HOT 2
- Cannot Remap keys on Phillips G404 Keyboard HOT 1
- [question] how to properly re-map `fn+rightctrl` to `context_menu`? HOT 3
- GUI editor for Evremap config files HOT 4
- key name for " quotation marks HOT 1
- Inability to use remapped keys to remap more keys HOT 2
- Hardcoded modifier keys with no configuration options HOT 3
- Not working properly in Sway + XKB HOT 2
- .tomf or .conf for the systemd service? HOT 1
- fails to start with exit code status=127 #issue HOT 3
- evremap (systemd service) does not start if the device its trying to remap is not connected HOT 1
- hoping to add copilot key support, or indirectly, remap using key code HOT 1
- Please publish on crates.io HOT 3
- Tap dance or multiple layer
- support mouse + keyboard combinations ?
- Invalid key KEY_DASHBOARD from Akko Keyboard HOT 2
- Application-specific remapping
- KEY_TILDE? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evremap.