Jump to content
The simFlight Network Forums

P3D 5.2 - LUA event handling not reliable

Recommended Posts


I am running P3D 5.2 HF 1 (version and FSUIPC 6.1.2 on WIN 10 with the latest updates. I have connected to my simulator several GoFlight hardware devices. I use them since already FSX days. I handle the input from these devices via LUA modules using the event.button function.

Since switching to 5.2 from 5.1 I have the problem, that few of the registered event.button functions (and sometimes also the event.offset functions) don't fire. Most of the buttons are working normally. The buttons themselves are recognized by FSUIPC, which I can check on the buttons page in the FSUIPC UI. And there are always some different buttons, where the events are not detected by LUA. Completely random.

The FSUIPC logfile shows no errors and I didn't change anything during the upgrade. If I manually restart the single module, where one or more event.button functions are not firing, via ipc.runlua(), the module works then as expected.

I start all my modules per ipc.runlua() out of a loop in a start module. This always worked fine in the past. The table AC.GF holds the specific modules for the current aircraft.

local k=0
local j=0
local v=""

for  k in pairs(AC.GF) do

	for j,v in ipairs(AC.GF[k]) do
		ipc.runlua ( v )
		ipc.log (v.." initialized")


As the error is randomly occuring, I have no idea, how to find the reason. The only common thing is, that it has todo with the handling of events in LUA. When I upgraded to P3D 5.2 there was also a WIN 10 update provided at the same time (2021-06 Windows 10 21H1). Not sure if it is P3D 5.2 or maybe the WIN 10 update producing this random errors. . Anyhow since that time I can't be sure, that all of my programmed events are really working. And it's independent of the plane I am using.

Maybe you have an idea, what might have changed with the event handling in 5.2.

Best regards



Link to comment
Share on other sites

Hi Reinhard.

this seems rather strange. I don't understand how a P3D or windows update could affect the lua event handling. There was no change in the FSUIPC6 version you were using, no? Its also strange that is affecting both event.offset and event.button functions.
Are you sure that you luas are actually still running when this occurs?

Maybe you can activate logging for buttons and keys, as well as lua plugins (but not Lua plugins separately), and show me the log file produced when your issue occurs.




Link to comment
Share on other sites


Yes these modules are running (partially). I have for example a LUA module for handling NAV1 on a GF module. Most of the events are handled correctly (inc/dec frequency for example) and few events in that module are not reacting (e.g. swapping frequencies). And the real strange thing is, that if I check via the FSUIPC UI on the button page, the same button is recognized. I run this code already very long from FSX over several P3D versions. Until my upgrade to 5.2 (and 5.2 with HF1) it worked without any problem. And another strange thing: One time it's NAV1, the other time it might be another button from a completely other module.

I know, that you don't have any chance to reproduce - even I am not able to have a scenarion, where it always happens. My hope is, that others might experience the same and that we can come to a pattern.



Link to comment
Share on other sites

It is strange that this issue started after a P3D update, but I really can't see how that can affect something like event.button, which is completely independent of P3D (i.e. P3D is not involved at all).

Anyway, try activating the suggested logging, as this may show you something when this happens again - i.e. if the button presses are received, and if anything is picked up by your lua scripts.




  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.