ark1320 Posted January 28, 2015 Report Posted January 28, 2015 Hi Pete, I'm trying to find a way to make FSUIPC keypress trapping conditional, or "seem" conditional. I use FSUIPC key assignments to control a Lua application, and thus these keys are trapped by FSUIPC. But based on a condition within the application, I would like the associated keypress (key code) passed onto FSX for normal processing, thus in effect implementing what looks like conditional keypress trapping by FSUIPC. The keypress parameter could be used to identify the key to the Lua application, so I guess the critical question is whether or not there's a way to have the Lua program pass a key code to FSX. Does this seem feasible, or am I way off base here in my thinking? Thx, Al
aua668 Posted January 28, 2015 Report Posted January 28, 2015 Hi, If you use the event.key function trigger, you get the keycode, shift and downup as parameters. So whatever key was pressed you could react in your LUA function triggered by this event. Lua library manual page 23. No need to use the FSUIPC key assignment in that case. You trap the key directly in the LUA. Rgds Reinhard
ark1320 Posted January 28, 2015 Author Report Posted January 28, 2015 Reinhard, I'm not sure the event.key trigger will meet my needs, but will certainly look into it. In my application, once the user sends the "Off key" to the Lua app, all subsequent app control keys need to be simply passed onto FSX for normal processing until the app receives the "On key". This is complicated by the fact that each user defines what set of keys they want to use for app control (although they currently do have to use appropriate keypress parameters associated with each control function). In any case, thanks very much for the suggestion. Al
Pete Dowson Posted January 28, 2015 Report Posted January 28, 2015 In my application, once the user sends the "Off key" to the Lua app, all subsequent app control keys need to be simply passed onto FSX for normal processing until the app receives the "On key". This is complicated by the fact that each user defines what set of keys they want to use for app control (although they currently do have to use appropriate keypress parameters associated with each control function). Event trapping in Lua can be cancelled too. And it is pretty easy for a Lua program to read some sort of parameter file f that's the way you want the keys defined. On your original post: I guess the critical question is whether or not there's a way to have the Lua program pass a key code to FSX Yes, of course. ipc.keypress or ipc.keypressplus. Pete
ark1320 Posted January 28, 2015 Author Report Posted January 28, 2015 Thank you Pete, much appreciated. Al
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