MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / KeyPress

Method KeyPress

src/lua/LuaHandleCallIns.cpp:642–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640//============================================================================//
641
642bool LuaHandle::KeyPress(bool taken, int key, int mods) {
643 BzfDisplay* dpy = getDisplay();
644 if (dpy == NULL) {
645 return false;
646 }
647
648 LUA_CALL_IN_CHECK(L, 3)
649 if (!PushCallIn(LUA_CI_KeyPress)) {
650 return false; // the call is not defined, do not take the event
651 }
652
653 lua_pushboolean(L, taken);
654 lua_pushinteger(L, key);
655 lua_pushinteger(L, mods);
656
657 if (!RunCallIn(LUA_CI_KeyPress, 3, 1)) {
658 return false;
659 }
660
661 return PopBool(L, false);
662}
663
664
665bool LuaHandle::KeyRelease(bool taken, int key, int mods) {

Callers 1

handleEventFunction · 0.45

Calls 4

PopBoolFunction · 0.85
getDisplayFunction · 0.50
lua_pushbooleanFunction · 0.50
lua_pushintegerFunction · 0.50

Tested by

no test coverage detected