Skip to content

Commit

Permalink
BACKENDS: Add EVENT_CLIPBOARD_UPDATE event
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 authored and bluegr committed Sep 21, 2019
1 parent ec4c846 commit 7bf22fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backends/events/sdl/sdl-events.cpp
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion common/events.h
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions engines/wage/gui.cpp
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7bf22fa

Please sign in to comment.