Jump to content
The simFlight Network Forums

Mouse Click Key Simulation


Recommended Posts

Hi Pete,

In an attempt to simulate a mouse click with a key stroke, in the FSUIPC Key Press tab I activate a Lua script with an ipcPARAM of 0 on the key downstroke, and then call the same Lua script with an ipcPARAM of 1 on key release. The Lua script tests the value of ipcPARAM to determine what action to take. I’m not getting the results I expect, especially if the key down is held a bit longer than usual (like holding a mouse button down) and wonder if there are some inherent timing issues that may be the problem since the same script is called both on key down and key release. I have tried this with No repeats! both checked and unchecked in the FSUIPC Key Press tab.

Thx,

Al

Link to comment
Share on other sites

I need more information really. For example, what's the difference betrween what you expect and what you get? 

Have you tried using any of the Logging to see what is happening?

It would also help if you pasted your Lua script into your message, as I've no idea what it looks like.

By invoking it each time you are loading and recompiling the source for each press and release. Not that this takes as long as your press, but still. It is inefficient. And FSUIPC will impose a delay before reinvoking the same plugin if the current one is still closing and freeing resources. You could see if that is causing your problem, whatever it is, by making two copies, one each handling the separate event (press or release).

BTW a much better and more efficient technique for plug-ins would be to use Events -- have the plug-in loading automatically at the start, then just program your keystrokes to send it parameters, or more simply having it detect the keypresses itself using key events, saving you even the assignments.

Pete

 

Link to comment
Share on other sites

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.