Jump to content
The simFlight Network Forums

Another non Aircraft specific Question - Detect a specific Keypress


Recommended Posts

Posted

Hello,
in my Script, i need to detect the Press of specific Keys and do some Action, if the Key is pressed.
I tried with this one: if ipc.keypressplus(104,8) == 0 then ..........
If detected, that NumPad 8 is pressed and released the Script will send some Instructions to the Plane.
But unfortunately that does'nt work.
Could you please offer a Solution for it? Thanks in Advance, Joachim

Posted
42 minutes ago, Airbuspilot said:

in my Script, i need to detect the Press of specific Keys and do some Action, if the Key is pressed.
I tried with this one: if ipc.keypressplus(104,8) == 0 then ..........

ipc.keypressplus( (and ipc.keypress) send keys to the FS, as it says in the documentation. You cannot use those functions to test for a keypress. They also do not return any value.

Use event.key - see the Lua Library documentation in how to use this function.

John

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.