Open supertriodo opened 1 year ago
This requres a new macro, maybe something like while_eq
, which works similar to if_eq
, but repeats the macro similar to repeat
Writing macros is actually fairly easy. See the various add_...
functions in inputremapper/injection/macros/macro.py
it could then be used like
set(toggle, 1).while_eq(
$toggle,
1,
hold(key(BTN_LEFT).wait(200))
)
the button that stops the loop:
set(toggle, 0)
That sounds great, I'll watch closely for when it's implemented, thanks for the answer!
Bumping this, it would be a fantastic feature to have included soon, and would functionally allow input-remapper to be a reasonable replacement for AutoHotKey that works with Linux for the people that want to make clickers etc. May look into implementing it myself as well potentially.
Just leaving this here as an idea how to solve this with mapping handlers (from https://github.com/sezanzeb/input-remapper/pull/578#issuecomment-1374673063):
Add a InputConfig.toggle parameter which can solve https://github.com/sezanzeb/input-remapper/issues/547 and https://github.com/sezanzeb/input-remapper/issues/378 by inserting a ToggleHandler in the event-pipeline
Would something like this work? (This exact example doesn't work)
Set a
to hold(key(BTN_LEFT).wait(200))
Set b
to if_eq($toggle, 0, key_down(a).set(toggle, 1), key_up(a).set(toggle, 0))
Hey there! First thanks for all the hard work in such an amazing tool. I use it everyday for all my games.
I can make an autoclicker of left click linking it to right click as long as I press it.
hold(key(BTN_LEFT).wait(200))
But, is there a way to make it so when I right click it starts the autoclick (on left click) until I press it again (right click)?
Thanks!