input-remapper icon indicating copy to clipboard operation
input-remapper copied to clipboard

How to do "mouse(down, 60)" and "hold_keys(BTN_LEFT)"?

Open JordanPavlic opened this issue 1 year ago • 1 comments

I want to hold the mouse button to fire in a game and at the same time scroll down the mouse to overcome the gun recoil. Doing "hold_keys(BTN_LEFT).mouse(down, 60)" causes the fire button to be held and the scroll to happen after releasing the input button. How do I have it repeat both clicking the left mouse and scrolling down at the same time?

JordanPavlic avatar Sep 20 '24 03:09 JordanPavlic

What about these:

  1. Try replacing the .mouse with ,mouse in your original macro.
  2. hold_keys(BTN_LEFT,mouse(down,60))

I enclosed the desired hold sequence in parenthesis, indicating that the entire macro inside it should be executed. Try this also with the period or comma. In the examples.md file, there is this: hold_keys(Control_L, a) holds down those two keys

It looks like they used a comma to hold the keys down instead of a period. If I remember right, a period tells Input-Remapper to execute each key before doing the next step, and the BTN_LEFT is not considered complete until it has the key down and key up completed, THEN will continue with the mouse function. Since you are holding the key down, it waits untill you release the key before moving the mouse.

Hope that works, just guessing on my part.

TherinS avatar Sep 26 '24 01:09 TherinS

~try key(BTN_LEFT).mouse(down, 60)~

sezanzeb avatar Dec 29 '24 18:12 sezanzeb

or

key_down(BTN_LEFT)
.mouse(down, 60)
.key_up(BTN_LEFT)

which holds down BTN_LEFT while it moves the mouse down.

sezanzeb avatar Dec 29 '24 19:12 sezanzeb

You can also do

hold(
  key(BTN_LEFT)
  .event(EV_REL, REL_Y, 60)
  .wait(100)
)

Which presses BTN_LEFT and moves down your mouse repeatedly every 100ms.

sezanzeb avatar Dec 29 '24 19:12 sezanzeb