While Device Key Is Pressed, Keep Key Pressed


I am trying to get a thing to work here, that probably is simple, but that I am unable to figure out:

While an external device is key pressed, F9 should be pressed.
When the external device key is released, F9 should be released as well.

I have tried this:

I have also added a corresponding release action:

But it does not work. It does not even seem to press the key.

Any ideas?

Thanks and regards,

This does not work because Press & Hold actions release their key when the macro stops. So your first macro will accomplish nothing other than pressing and releasing the F9 key.

The macro must continue running, thus it must look like:

Press and Hold F9

Ideally it would be Pause Until USB Device Key is up, but sadly there is no condition for that. So you have to fake it. Change it to:

Set Variable DR Button Down to 1
Press and Hold F9
Pause Until Variable DR Button Down is not 1

Macro 2:
Set Variable DR Button Down to 0

Similarly, if I made Cmd+2 stand for a left mouse click. Is it possible that keeping pressing Cmd+2 stands for keeping pressing left mouse click?

Sorry for bothering you.

These two Macro don't work well, (especially when imitating hold left mouse + mouse move as selecting text):

do fake left click.kmmacros (3.0 KB)
when release, change var.kmmacros (1.5 KB)

the other Macro:

You are not holding the mouse in the second action of the first macro.

But note that simulated events and real events cannot be intermingled, so if you intention is to simulate holding the mouse button down while you physically drag the mouse, it probably wont work.

Since this demand of mine is not necessary, just ignore it. And thanks.