DragonflightDesign
Resource contributor
- Messages
- 1,369
- Country

Maskable events doesn't seem to operate the way I expect. Code follows:
When I press the A key it's correctly trapped by the event but the cockpit camera also activates. It's my expectation that I'll trap the A key but the cockpit camera does not change, so I've either missed or misunderstood something (or both). I've looked at the PMDG-style code here:
www.fsdeveloper.com
and it would be easy enough to copy it and modify it suit my need, but that would rather defeat the object of trying to find out what I've done wrong and knowing how maskable events work.
Code:
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, KEY_A);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, KEYBOARD_INPUT, "a", KEY_A, true);
// Sign up for notifications
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_KEYBOARD, KEY_A);
// Set a high priority for the group
// hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_KEYBOARD, KEY_A, SIMCONNECT_GROUP_PRIORITY_HIGHEST);
hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_KEYBOARD, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);
// At another place in the code where I can be sure the sim is fully started:
if (isLoaded)
{
hr = SimConnect_SetInputGroupState(hSimConnect, KEYBOARD_INPUT, SIMCONNECT_STATE_ON);
}
C: PMDG-style keyboard entry - FSDeveloper Wiki
and it would be easy enough to copy it and modify it suit my need, but that would rather defeat the object of trying to find out what I've done wrong and knowing how maskable events work.
