MCPcopy Create free account
hub / github.com/danomatika/ofxLua / scriptKeyPressed

Method scriptKeyPressed

src/ofxLua.cpp:300–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300void ofxLua::scriptKeyPressed(int key) {
301 if(L == NULL || !isFunction("keyPressed")) {
302 return;
303 }
304 lua_getglobal(L, "keyPressed");
305 lua_pushinteger(L, key);
306 if(lua_pcall(L, 1, 0, 0) != 0) {
307 std::string msg = "Error running keyPressed(): "
308 + (std::string) lua_tostring(L, LUA_STACK_TOP);
309 errorOccurred(msg);
310 }
311}
312
313void ofxLua::scriptKeyReleased(int key) {
314 if(L == NULL || !isFunction("keyReleased")) {

Callers 2

keyPressedMethod · 0.80
keyPressedMethod · 0.80

Calls 2

lua_getglobalFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected