Marcelo peixoto Posted May 23, 2012 Report Share 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. Link to comment Share on other sites More sharing options...
Pete Dowson Posted May 24, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Pete Dowson Posted May 24, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Marcelo peixoto Posted May 24, 2012 Author Report Share Posted May 24, 2012 Tanks Pete! The 9 in red wait a Ctrl command before the "H" key. Sory, i wrote wrong. Link to comment Share on other sites More sharing options...
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