Possible problem with "register_key_event_handler"

Pete Dowson
Posts: 612
Joined: Sat Dec 18, 2010 3:45 pm

Possible problem with "register_key_event_handler"

Postby Pete Dowson » Wed Dec 19, 2018 3:04 pm

In FSUIPC I've always used the Gauges API function register_key_event_handler in order, mainly, to offer the option to log key events to help folks resolve problems with their settings.

But I've discovered that just doing this, with no other action taken in the called handler function, certain KEY EVENTS are followed immediately by one or two "KEY ATC MENU CLOSE" events. (It seems to alternate with each use of the triggering event between one and two of these ATC MENU CLOSE events).

The triggering events are those which can be followed by a SELECT 1-4 event, such as TOGGLE AIRCRAFT EXIT, PUSHBACK, and ENGINE. The intervention of those spurious ATC MENU CLOSE events prevents the SELECT from being effective.

If the events are not intercepted then this problem appears not to happen.

So, my questions:
1. Why is this happening?
2. How can it be prevented?
3. Is there (now) a better way to intercept KEY EVENTS, perhaps via PDK facilities?

In FS9, FSX and early P3D days, the interception was possible in the main FS98MAIN window function, as they all passed through as WM_COMMANDs. At some stage in P3D development (version 4?) this seemed to be changed.

Pete
My System

Win10: 2004 build 19041.264
Processor: I9 9900KS at 5.5GHz
Mobo: Maximus XI Extreme Z390
Memory: 32Gb at 3900 MHz.
GPU: RTX 24Gb Titan
Displays: 2 x 2160p projectors at 30Hz onto 200 FOV curved screen
P3D4 set with 2 windows using ViewGroups

Pete Dowson
Posts: 612
Joined: Sat Dec 18, 2010 3:45 pm

Re: Possible problem with "register_key_event_handler"

Postby Pete Dowson » Wed Dec 19, 2018 6:31 pm

I've been doing lots of tests, and it appears this problem goes back to FSX. It isn't specific to P3D. But I cannot understand why it hasn't caused problems (before).

FSUIPC does use SimConnect's "Macro begin/end" facilities to try to group those Key Events which can take a Select 1-4 qualification with that event. This evidently succeeds in covering up this oddity, though because I've now had a user report that the Shift+E keypress doesn't select other doors with the Select key following, maybe the problem is in the way the Macro facility is operating.

I'll continue investigating, but I would be interested in any theories about what could be causing these spurious ATC MENU CLOSE events.

And is there any way of logging KEY EVENTS without intercepting them? Anything in SimConnect logging? I'd like to see what happens with no add-ons at all running.

Pete
My System

Win10: 2004 build 19041.264
Processor: I9 9900KS at 5.5GHz
Mobo: Maximus XI Extreme Z390
Memory: 32Gb at 3900 MHz.
GPU: RTX 24Gb Titan
Displays: 2 x 2160p projectors at 30Hz onto 200 FOV curved screen
P3D4 set with 2 windows using ViewGroups

Pete Dowson
Posts: 612
Joined: Sat Dec 18, 2010 3:45 pm

Re: Possible problem with "register_key_event_handler"

Postby Pete Dowson » Wed Dec 19, 2018 11:11 pm

I've now had a user report that the Shift+E keypress doesn't select other doors with the Select key following, maybe the problem is in the way the Macro facility is operating.

No, the macro facility must be working okay, as the FSUIPC provisions for that are certainly enabling the Shift+E then Select event to work correctly to select the exits. Either that, or P3D4 now doesn't allow intervening Events to destroy the relationship of the Select Event with the relevant preceding event (which was the problem in FSX for sure). I'd be interested in L-M's take on that.

I would still be very interested in any theories about what could be causing these spurious ATC MENU CLOSE events.

The problems on my User's system must be specific to his system. Some interaction with another add-on is my guess. I've asked him to test with no other add-ons. We'll see.

Pete
My System

Win10: 2004 build 19041.264
Processor: I9 9900KS at 5.5GHz
Mobo: Maximus XI Extreme Z390
Memory: 32Gb at 3900 MHz.
GPU: RTX 24Gb Titan
Displays: 2 x 2160p projectors at 30Hz onto 200 FOV curved screen
P3D4 set with 2 windows using ViewGroups


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 9 guests