MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / OnKeyPressed

Function OnKeyPressed

test/browser/test_glfw.c:253–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void OnKeyPressed( int key, int action ){
254 const char* key_name = GetKeyName(key);
255 if (key_name == 0) {
256 return;
257 }
258 if (action == GLFW_PRESS) {
259 printf("'%s' (%i) key is pressed\n", key_name, key);
260 }
261 if (action == GLFW_RELEASE) {
262 printf("'%s' (%i) key is released\n", key_name, key);
263 }
264 if (action == GLFW_RELEASE && key == GLFW_KEY_ENTER) {
265 PullInfo();
266 }
267}
268
269int OnClose(){
270 printf("Closed\n");

Callers

nothing calls this directly

Calls 3

GetKeyNameFunction · 0.85
printfFunction · 0.85
PullInfoFunction · 0.85

Tested by

no test coverage detected