osre icon indicating copy to clipboard operation
osre copied to clipboard

Refactoring: Keyboard-Listener

Open kimkulling opened this issue 7 months ago • 0 comments

void KeyboardEventListener::onOSEvent(const Event &osEvent, const EventData *data) {

  • if (data == nullptr) {
  •    return;
    
  • } auto *keyData = static_cast<KeyboardButtonEventData *>(data); if (osEvent == Platform::KeyboardButtonDownEvent) { mKeyboardInputState.mKeymap[keyData->m_key] = 1; mKeyboardInputState.mLast = keyData->m_key;
  • } else {
  • } else if (osEvent == Platform::KeyboardButtonUpEvent) { mKeyboardInputState.mKeymap[keyData->m_key] = 0; mKeyboardInputState.mLast = Platform::KEY_UNKNOWN; } }

kimkulling avatar Apr 03 '25 21:04 kimkulling