Helper method to update the state of a given flag according to a toggle.
| 106 | |
| 107 | // Helper method to update the state of a given flag according to a toggle. |
| 108 | static void setStateByFlag(bool shouldSetFlag, UINT flagValue) |
| 109 | { |
| 110 | if (!gEnablePersistentEventFiring) { |
| 111 | // Persistent event firing is disabled. |
| 112 | return; |
| 113 | } |
| 114 | if ((hConstantEventsThread == NULL) || (EVENT_FIRING_DATA == NULL)) { |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | WPARAM currentInputState = EVENT_FIRING_DATA->getInputDevicesState(); |
| 119 | if (shouldSetFlag) { |
| 120 | currentInputState |= flagValue; |
| 121 | } else { |
| 122 | currentInputState = currentInputState & (~flagValue); |
| 123 | } |
| 124 | EVENT_FIRING_DATA->setInputDevicesState(currentInputState); |
| 125 | } |
| 126 | |
| 127 | void updateShiftKeyState(bool isShiftPressed) |
| 128 | { |
no test coverage detected