MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / key

Method key

src/main/java/field/graphics/Windows.java:248–272  ·  view source on GitHub ↗
(long window, int key, int scancode, int action, int mods)

Source from the content-addressed store, hash-verified

246 @Override
247 public void key(long window, int key, int scancode, int action, int mods) {
248
249 // we occasionally get a spurious 'a' (scancode 0) on command-tabbing to our application. If it's just a plain 'a' let's assume that the character callback will handle it
250 //if (scancode == 0 && mods == 0) return;
251
252 Runnable r = () -> {
253 checkClassLoader();
254 GlfwCallback a = adaptors.get(window);
255 if (a != null)
256 a.key(window, key, scancode, action, mods);
257 };
258
259 if (checkThread()) r.run();
260 else {
261 events.addLast(r);
262 RunLoop.main.shouldSleep.add(Windows.this);
263 RunLoop.main.interrupt();
264 }
265 }
266
267 @Override
268 public void character(long window, int character) {
269// System.out.println("::Char "+character);
270 Runnable r = () -> {
271 checkClassLoader();
272 GlfwCallback a = adaptors.get(window);
273 if (a != null)
274 a.character(window, character);
275 };

Callers

nothing calls this directly

Calls 8

checkClassLoaderMethod · 0.95
keyMethod · 0.95
checkThreadMethod · 0.95
interruptMethod · 0.80
getMethod · 0.65
printlnMethod · 0.45
runMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected