May 21, 20251 yr I am trying to work out how to chain multiple commands together. For example, when I press button 1, I want it to send CTL+F12, followed by Numpad 6. When I press the same button again, I want it to send CTl+F11, followed by Numpad 5. How do I achieve this? Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 11Link to my: Dynamic Flight Dispatch Tool
May 21, 20251 yr Commercial Member 5 hours ago, toby23 said: How do I achieve this? By using scripts. LORBY-SI
May 21, 20251 yr Author Ok, as I find RPN really difficult to understand, could you please give me an example based on my chain? So that I can learn how to use RPN? I don't understand how to send keyboard commands in an RPN script. I have read this doc at the SDK page but it has not answered my question. https://docs.flightsimulator.com/html/Additional_Information/Reverse_Polish_Notation.htm thank you Edited May 21, 20251 yr by toby23 Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 11Link to my: Dynamic Flight Dispatch Tool
May 21, 20251 yr Commercial Member 1 hour ago, toby23 said: I don't understand how to send keyboard commands in an RPN script On the AAO script editor there is a button "Insert vKey" The RPN dialect in AAO has been expanded massively over the default simulator spec. The AAO manual contains lists with all the extra operators and commands. If you feel more comfortable with Javascript, JScript or VBScript, you can use those too. Edited May 21, 20251 yr by Lorby_SI LORBY-SI
May 21, 20251 yr Commercial Member 1 hour ago, toby23 said: could you please give me an example based on my chain? Not at the moment, sorry. Making a button do different things, every time you press it, is a complex use case that requires some serious thought. And the use of a control LVar. Any some reset criteria (what happens when you don't follow through with the sequence) It would probably be best split into several parts calling each other. Remember to include the (FOCUS: command to set the Windows app focus on MSFS before sending virtual keys. Edited May 21, 20251 yr by Lorby_SI LORBY-SI
May 21, 20251 yr Author 17 minutes ago, Lorby_SI said: On the AAO script editor there is a button "Insert vKey" The RPN dialect in AAO has been expanded massively over the default simulator spec. The AAO manual contains lists with all the extra operators and commands. If you feel more comfortable with Javascript, JScript or VBScript, you can use those too. Appreciate you are trying to help but why is it so complicated to send a series of keyboard inputs? I could do this easily with the Thrustmaster Target software 15 years ago. All that I am trying to do is this... Press Button = Pause Track-IR > View Custom Camera Press Button again = Unpause Track-IR > View a different Custom Camera Surely something that simple can be accomplished with AAO easily? Edited May 21, 20251 yr by toby23 Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 11Link to my: Dynamic Flight Dispatch Tool
May 21, 20251 yr Commercial Member 1 hour ago, toby23 said: why is it so complicated to send a series of keyboard inputs It is what it is. AAO scripts are the way to go, and once you know your way around them, they are only as complex as you make them. I can't give you an example right now because I am still at work and can only write on my phone. But there are examples in the AAO manual. Edited May 21, 20251 yr by Lorby_SI LORBY-SI
May 21, 20251 yr Commercial Member A script would look something like this: (FOCUS:flightsimulator)·(SPLIT:100) (L:tirswitch)·0·==·if{· (VKD:29-157-162)·(VKD:88-216-123)·(SPLIT:100)·(VKU:88-216-123)·(VKU:29-157-162)· (SPLIT:100)·(VKD:77-205-102)·(SPLIT:100)·(VKU:77-205-102)·}·els{· (VKD:29-157-162)·(VKD:87-215-122)·(SPLIT:100)·(VKU:87-215-122)·(VKU:29-157-162)· (SPLIT:100)·(VKD:76-204-101)·(SPLIT:100)·(VKU:76-204-101)·}· 1·(L:tirswitch)·-·(>L:tirswitch) Assuming that we are talking about MSFS 2020 - otherwise the FOCUS statement is different. It sets the Windows focus on the app that you specify, so all key presses end up there and not somewhere else (with Windows, the focused app is "eating" all keyboard input) But these are the scan codes of MY keyboard, they don't have to be the same of YOURs. Internationally, keyboards are not the same, they all have different things painted on them and trigger different internals. Which is why AAO uses the low level scan codes. These you get with the aforementioned button on the Script Editor dialog in AAO. Meaning, you probably can't just copy and paste this code, you will have to re-type it and insert your own scan codes using the button. VKD is "virtual key down", VKU is "virtual key up". The 100ms SPLITs are necessary because MSFS can't handle key events that are coming in too fast. (L:tirswitch) is the control variable that makes the script react differently each time you call it. The variable alternates between 0 and 1 with each call. LVars can just be invented at any time, they don't have to "exist", they don't have to be registered. AAO will use them the first time they come up in a script, same as the sim. Make sure to read the AAO manual chapter about scripting (and LVars). Edited May 21, 20251 yr by Lorby_SI LORBY-SI
Create an account or sign in to comment