| 298 | } |
| 299 | |
| 300 | void 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 | |
| 313 | void ofxLua::scriptKeyReleased(int key) { |
| 314 | if(L == NULL || !isFunction("keyReleased")) { |
no test coverage detected