1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

key name capture

This commit is contained in:
Laserlicht
2025-07-19 13:09:15 +02:00
parent 6e61cb0cf3
commit 21df285e5a
10 changed files with 67 additions and 10 deletions

View File

@@ -43,6 +43,7 @@ void EventDispatcher::processLists(ui16 activityFlag, const Functor & cb)
processList(AEventsReceiver::TEXTINPUT, textInterested);
processList(AEventsReceiver::GESTURE, panningInterested);
processList(AEventsReceiver::INPUT_MODE_CHANGE, inputModeChangeInterested);
processList(AEventsReceiver::KEY_NAME, keyNameInterested);
}
void EventDispatcher::activateElement(AEventsReceiver * elem, ui16 activityFlag)
@@ -133,6 +134,22 @@ void EventDispatcher::dispatchShortcutReleased(const std::vector<EShortcut> & sh
}
}
void EventDispatcher::dispatchKeyPressed(const std::string & keyName)
{
EventReceiversList miCopy = keyNameInterested;
for(auto & i : miCopy)
i->keyPressed(keyName);
}
void EventDispatcher::dispatchKeyReleased(const std::string & keyName)
{
EventReceiversList miCopy = keyNameInterested;
for(auto & i : miCopy)
i->keyReleased(keyName);
}
void EventDispatcher::dispatchMouseDoubleClick(const Point & position, int tolerance)
{
handleDoubleButtonClick(position, tolerance);