MCPcopy Create free account
hub / github.com/crossuo/crossuo / OnKeyDown

Method OnKeyDown

src/GameWindow.cpp:361–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361void CGameWindow::OnKeyDown(const KeyEvent &ev)
362{
363 if (PLUGIN_EVENT(UOMSG_INPUT_KEYDOWN, &ev))
364 {
365 return;
366 }
367
368 const auto key = EvKey(ev);
369 const bool acceptKey = true;
370 if (acceptKey && g_CurrentScreen != nullptr && g_ScreenEffectManager.Mode == SEM_NONE)
371 {
372#if __APPLE__
373#define CMD_KEY g_CmdPressed
374#else
375#define CMD_KEY g_CtrlPressed
376#endif
377 if (CMD_KEY && key == SDLK_v && g_EntryPointer != nullptr)
378 {
379 if (g_GameState == GS_MAIN)
380 {
381 g_MainScreen.Paste();
382 }
383 else
384 {
385 g_EntryPointer->Paste();
386 }
387 }
388
389 g_CurrentScreen->OnKeyDown(ev);
390 }
391}
392
393void CGameWindow::OnKeyUp(const KeyEvent &ev)
394{

Callers

nothing calls this directly

Calls 1

PasteMethod · 0.45

Tested by

no test coverage detected