Open fhill2 opened 2 years ago
Similar issue: #7
What are your thoughts on this?
I agree evsieve needs a more ergonomic way to do this, but I have still not figured out the best way to do it. There are particularly a lot of edge cases to deal with if we want to conditionally block some input events depending on whether or not a multiple-to-one map happened or not.
--map key:leftctrl key:comma key:f4 source=2
I am not a fan of this syntax because its semantics are different from the usual --map
semantics.
If I were to expand the --map
to do this, I'd probably do something like --map key:comma key:f4 hold=key:leftctrl
, where hold=
indicates that the map only applies if the key:leftctrl
key is held down, though this approach still has two inelegant points:
hold=
would have to be interpreted with the same semantics as used by --hook
which are different from the semantics used by --map
(i.e. an unspecified event value is interpreted as 1~
by --hook
, whereas --map
interprets it as "any value");--toggle
treats EV_KEY type events differently from other events.... now I think about it, these two inelegant points may be less severe than the mess that --hook withhold
or --hook --withhold
might create. I should consider this approach some more.
(although not documented yet!)
The documentation in the README is for the latest stable version of evsieve (1.3.1 right now.) The send-key
clause is not part of any stable release yet. Features not part of a stable release are subject to getting changed/removed/redesigned at any time, therefore the average user is not recommended to use them.
By the way, in the above script you do not want to use mode=passive
on the --toggle
because your script would result in a stuck F4 key if you were to press key:leftctrl:1 key:comma:1 key:leftctrl:0 key:comma:0
. The consistent mode is the default mode of toggles because it avoids pitfalls like this.
Great to hear your thoughts on this and the edge cases that would have to be dealt with if being implemented.
-map key:comma key:f4 hold=key:leftctrl
is a better intuitive syntax.
Thank you for clarification on mode=passive
vs mode=consistent
that I overlooked in my original example.
If you do decide to implement, I'll be looking forward to such a feature.
Please correct if there is a better, simplified way I haven't found out yet to reach this desired behaviour:
maps that have 1 source event are intuitive in evsieve and come as a 1 liner:
--map key:f2 key:f3
An example of maps with 2 source events:
Ctrl+,
-->f4
afaik,
--toggle
--hook
need to be used in order to achieve maps with 2 source events.This could be simplified by adding the option to change the amount of source events to
--map
so it can behave like-hook
--map key:leftctrl key:comma key:f4 source=2
What are your thoughts on this?
EDIT: Changes introduced here can now accomplish the above using only --hook (although not documented yet!)
--hook key:leftctrl key:comma send-key='key:f4'