Register a built-in event so that it can be fired for libraries, etc. Supported events include: pre – at the very top of the draw() method (safe to draw) draw – at the end of the draw() method (safe to draw) post – after draw() has exited (not safe to draw) pause – called when t
(String methodName, Object target)
| 1387 | * @param target the target object that should receive the event |
| 1388 | */ |
| 1389 | public void registerMethod(String methodName, Object target) { |
| 1390 | switch (methodName) { |
| 1391 | case "mouseEvent" -> registerWithArgs("mouseEvent", target, new Class[] { MouseEvent.class }); |
| 1392 | case "keyEvent" -> registerWithArgs("keyEvent", target, new Class[] { KeyEvent.class }); |
| 1393 | case "touchEvent" -> registerWithArgs("touchEvent", target, new Class[] { TouchEvent.class }); |
| 1394 | default -> registerNoArgs(methodName, target); |
| 1395 | } |
| 1396 | } |
| 1397 | |
| 1398 | |
| 1399 | private void registerNoArgs(String name, Object o) { |
no test coverage detected