Skip to content

Refactoring: Keyboard-Listener #311

@kimkulling

Description

@kimkulling

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;
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions