BACKENDS: Add EVENT_CLIPBOARD_UPDATE event

This commit is contained in:
Cameron Cawley 2019-09-20 00:33:32 +01:00 committed by Filippos Karapetis
parent ec4c846e8c
commit 7bf22fa996
3 changed files with 11 additions and 1 deletions

View file

@ -650,6 +650,10 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
event.path = Common::String(ev.drop.file);
SDL_free(ev.drop.file);
return true;
case SDL_CLIPBOARDUPDATE:
event.type = Common::EVENT_CLIPBOARD_UPDATE;
return true;
#else
case SDL_VIDEOEXPOSE:
if (_graphicsManager)

View file

@ -90,7 +90,9 @@ enum EventType {
EVENT_JOYAXIS_MOTION = 24,
EVENT_JOYBUTTON_DOWN = 25,
EVENT_JOYBUTTON_UP = 26
EVENT_JOYBUTTON_UP = 26,
EVENT_CLIPBOARD_UPDATE = 27
};
const int16 JOYAXIS_MIN = -32768;

View file

@ -242,6 +242,10 @@ void Gui::regenWeaponsMenu() {
}
bool Gui::processEvent(Common::Event &event) {
if (event.type == Common::EVENT_CLIPBOARD_UPDATE) {
_menu->enableCommand(kMenuEdit, kMenuActionPaste, true);
}
return _wm.processEvent(event);
}