Keydown

Announcements, general discussion
Post Reply
FruTbun
Posts: 3
Joined: 08 Oct 2013, 07:54

Keydown

Post by FruTbun » 08 Oct 2013, 08:02

Morning all. Firstly thank you for this program. In my opinion a lot better than Xpadder & J2K.

I have a very simple Hurricane cockpit for Cliffs of Dover.

I have a push/pull switch to simulate the slow running cutout switch in the Hurricane cockpit. Pull to activate (this should send continuous keystrokes (activating the switch in game). The switch stays in this state until the switch is pushed in (closing it, with a single keystroke).

My problem is, only one keystroke is sent, when I pull the switch.

I have tried to find examples of other peoples work, and have gone through the "How To" section of the forum, but cannot quite find what I am looking for.

My script (and I don't really know what I am doing in this department) looks like this:

HIDMacros.IsButtonPressed "BU0836X Interface", 24
HIDMacros.SendKeys "J"

How do I keep the J key down, until I press the button in to close it?

Thanks to anyone who can point me in the right direction.

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Keydown

Post by admin » 09 Oct 2013, 08:02

You don't need IsButtonPressed in your script, link to button is mapped by macro itself. This call is additional tool for more complex scripts.
Anyway, yes, SendKeys sends only single keystroke.
So you need to achieve having joystick button simulating keyboard key? Pulling the switch (button) should press the key at keyboard and keep it pressed until you push it?
It's not possible at the moment. I could probably add commands to press & hold some key and another for release, but not sure if it would solve your problem...
Petr Medek
LUAmacros author

FruTbun
Posts: 3
Joined: 08 Oct 2013, 07:54

Re: Keydown

Post by FruTbun » 09 Oct 2013, 08:42

That's it Peter.

Touchbuddy had a "hold" macro, which would select the macro (hold it), then deselect it when pressed again.

The Slow Running Cut-Out switch in the hurricane cockpit is like an old car choke lever. You pull the lever out (Keyboard J) and hold it until the Propeller stops. Pushing the button back in, would send a single "J" to stop the action.

Thank you for taking the time to provide an answer.

Regards.

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Keydown

Post by admin » 09 Oct 2013, 11:59

As I said. I could add special commands to send only key down or only key up windows message. But I can not tell whether it would be correctly recognized by your game.
Providing a command that would send repeatedly keystrokes until explicitly cancelled would be quite complicated.
Petr Medek
LUAmacros author

FruTbun
Posts: 3
Joined: 08 Oct 2013, 07:54

Re: Keydown

Post by FruTbun » 10 Oct 2013, 07:54

Once again Pete. Thanks for the reply. I have found a solution:

I have found a short term solution. I use Joy2Key purely for this one function. Using Toggle switches with J2k on some switches results in a continuous key press (that's why I think your program is a godsend for physical switch users).

In Joy2Key my Slow Running Cut-Out switch has been set up (select mode) in the "Auto Repeat & Toggle Menu" to send 30 J's per second. The deselect (single J) still comes from HID Macros The Slow Running Cut-Out is not used a great deal to be honest, but it is good that at least it now works as it should.

Post Reply