Marcelo peixoto Posted May 23, 2012 Report Posted May 23, 2012 Hi friends! Houston, I have a problem! I made a simple code in LUA to transform a keypress in a Toggle for the APU Start, becase this entry don´t have a toggle option, and i need this in toggle. The code work´s fine if use a simple key like "H" in below exemple. This on and off the Apu Starter when the H key is pressed. But if i try send a keypress with Ctrl + H or Shift + H the code only run a single time, case the event key don´t release. the code that works -------------------------------------- apustr = 0 function start_apu(keycode, shifts) if apustr == 0 then apustr = 1 ipc.writeSB("0b58", 1) ipc.display("apu on") else apustr = 0 ipc.writeSB("0b58", 0) ipc.display("apu off") end end event.key(72, 8, "start_apu") -------------------------------------- The code with error apustr = 0 function start_apu(keycode, shifts) if apustr == 0 then apustr = 1 ipc.writeSB("0b58", 1) ipc.display("apu on") else apustr = 0 ipc.writeSB("0b58", 0) ipc.display("apu off") end end event.key(72, 9, "start_apu") -------------------------------------- The 9 in red wait a Ctrl command before the "H" key. Tanks for help.
Pete Dowson Posted May 24, 2012 Report Posted May 24, 2012 I made a simple code in LUA to transform a keypress in a Toggle for the APU Start, becase this entry don´t have a toggle option, and i need this in toggle. The code work´s fine if use a simple key like "H" in below exemple. This on and off the Apu Starter when the H key is pressed. But if i try send a keypress with Ctrl + H or Shift + H the code only run a single time, case the event key don´t release. Yes, I can verify this. Looks like a bug. Sorry -- I will fix it today. The 9 in red wait a Ctrl command before the "H" key. actually '9' is for Shift. Ctrl would be 10. Regards Pete
Pete Dowson Posted May 24, 2012 Report Posted May 24, 2012 I will fix it today. Fixed in FSUIPC 4.831 and 3.999m, available now in the Download Links subforum. Regards Pete
Marcelo peixoto Posted May 24, 2012 Author Report Posted May 24, 2012 Tanks Pete! The 9 in red wait a Ctrl command before the "H" key. Sory, i wrote wrong.
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