Jump to content
The simFlight Network Forums

Delay between key presses?


pilotjohn
 Share

Recommended Posts

Is there a way to insert delays between key presses? MSFS seems very finicky about it's configured keyboard shortcuts (and a kludge with what it does with them). For example Alt+0 "loads saved camera 0" so I would simply expect a second press to do nothing. Instead it return to the default camera (even if you pan-ed away). As I result I'd like to send two Alt+0 to center the view (one to return to default camera - which it shouldn't be doing but so it does, and the second to return to the saved camera). This seems unreliable with a sequence, I assume because of how fast it happens. I'd like to insert a delay between them.

Link to comment
Share on other sites

10 hours ago, pilotjohn said:

Is there a way to insert delays between key presses?

Not using key press assignments. You can achieve this using lua scripts, by using ipc.keypress (or ipc.keypressplus) and ipc.sleep for the delay. You would then have to assign a different key press (or button) to activate the lua script.

Link to comment
Share on other sites

On 9/16/2020 at 4:17 AM, John Dowson said:

Not using key press assignments. You can achieve this using lua scripts, by using ipc.keypress (or ipc.keypressplus) and ipc.sleep for the delay. You would then have to assign a different key press (or button) to activate the lua script.

Feature request please: be able to do this without having to create 100+ Lua scripts (or one giant one). Maybe adding a param after the key as the delay, and they could be executed in the order listed in the INI.

  • Confused 1
Link to comment
Share on other sites

  • 1 month later...

@pilotjohn Rather than confusing the button/key definition with adding syntax for a delay, I've decided to add a pause control (C1152). You can use this to add a delay either before or after a keypress or button assignment, by overloading the assignment. Here's an example of inserting a delay between two controls being sent (to control the 3-way off->Taxi->LNG lights toggle in the TBM930):

Quote

34=PT,11,C65751,0     -{LANDING_LIGHTS_TOGGLE}-
35=PT,11,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
36=UT,11,C65751,0     -{LANDING_LIGHTS_TOGGLE}-
37=UT,11,C1152,600     -{}-
38=UT,11,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
39=PT,12,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
40=UT,12,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
 

The parameter to the control is the delay in milliseconds (600ms in the above example).

(NB. there is minor issue in that the FSUIPC added controls are currently not annotated/commented correctly)

This added control is available in version 7.0.2a attached below.

Cheers,

John

FSUIPC7.exe

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.