Changeset View
Changeset View
Standalone View
Standalone View
source/gui/tests/test_GuiManager.h
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | void test_hotkeysState() | ||||
scriptInterface.CreateObject(cx, &val); | scriptInterface.CreateObject(cx, &val); | ||||
std::shared_ptr<ScriptInterface::StructuredClone> data = scriptInterface.WriteStructuredClone(JS::NullHandleValue); | std::shared_ptr<ScriptInterface::StructuredClone> data = scriptInterface.WriteStructuredClone(JS::NullHandleValue); | ||||
g_GUI->PushPage(L"hotkey/page_hotkey.xml", data, JS::UndefinedHandleValue); | g_GUI->PushPage(L"hotkey/page_hotkey.xml", data, JS::UndefinedHandleValue); | ||||
// Press 'a'. | // Press 'a'. | ||||
SDL_Event_ hotkeyNotification; | SDL_Event_ hotkeyNotification; | ||||
hotkeyNotification.ev.type = SDL_KEYDOWN; | hotkeyNotification.ev.type = SDL_KEYDOWN; | ||||
hotkeyNotification.ev.key.keysym.sym = SDLK_a; | hotkeyNotification.ev.key.keysym.scancode = SDL_SCANCODE_A; | ||||
hotkeyNotification.ev.key.repeat = 0; | hotkeyNotification.ev.key.repeat = 0; | ||||
// Init input and poll the event. | // Init input and poll the event. | ||||
InitInput(); | InitInput(); | ||||
in_push_priority_event(&hotkeyNotification); | in_push_priority_event(&hotkeyNotification); | ||||
SDL_Event_ ev; | SDL_Event_ ev; | ||||
while (in_poll_event(&ev)) | while (in_poll_event(&ev)) | ||||
in_dispatch_event(&ev); | in_dispatch_event(&ev); | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator