pilotjohn Posted September 15, 2020 Report Posted September 15, 2020 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.
John Dowson Posted September 16, 2020 Report Posted September 16, 2020 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.
pilotjohn Posted September 17, 2020 Author Report Posted September 17, 2020 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. 1
John Dowson Posted September 18, 2020 Report Posted September 18, 2020 @pilotjohn I'll add this to my list and look into it when time permits.
John Dowson Posted November 16, 2020 Report Posted November 16, 2020 @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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now