Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUI.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
InReaction CGUI::HandleEvent(const SDL_Event_* ev) | InReaction CGUI::HandleEvent(const SDL_Event_* ev) | ||||
{ | { | ||||
InReaction ret = IN_PASS; | InReaction ret = IN_PASS; | ||||
if (ev->ev.type == SDL_HOTKEYDOWN || ev->ev.type == SDL_HOTKEYUP) | if (ev->ev.type == SDL_HOTKEYDOWN || ev->ev.type == SDL_HOTKEYUP) | ||||
{ | { | ||||
const char* hotkey = static_cast<const char*>(ev->ev.user.data1); | const char* hotkey = static_cast<const char*>(ev->ev.user.data1); | ||||
if (m_GlobalHotkeys.count(hotkey)) | if (m_GlobalHotkeys.count(hotkey) && ev->ev.type == SDL_HOTKEYDOWN) | ||||
{ | { | ||||
HotkeyInputHandler(ev); | HotkeyInputHandler(ev); | ||||
ret = IN_HANDLED; | ret = IN_HANDLED; | ||||
JSContext* cx = m_ScriptInterface->GetContext(); | JSContext* cx = m_ScriptInterface->GetContext(); | ||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | ||||
JS::RootedObject globalObj(cx, &GetGlobalObject().toObject()); | JS::RootedObject globalObj(cx, &GetGlobalObject().toObject()); | ||||
JS::RootedValue result(cx); | JS::RootedValue result(cx); | ||||
▲ Show 20 Lines • Show All 1,304 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator