MCPcopy Create free account
hub / github.com/Card-Forge/forge / keyDown

Method keyDown

forge-gui-mobile/src/forge/card/CardZoom.java:437–460  ·  view source on GitHub ↗
(int keyCode)

Source from the content-addressed store, hash-verified

435 }
436
437 @Override
438 public boolean keyDown(int keyCode) {
439 if (Forge.hasGamepad()) {
440 if (keyCode == Input.Keys.DPAD_LEFT)
441 fling(300, 0);
442 else if (keyCode == Input.Keys.DPAD_RIGHT)
443 fling(-300, 0);
444 else if (keyCode == Input.Keys.BUTTON_B)
445 hideZoom();
446 else if (keyCode == Input.Keys.BUTTON_A)
447 fling(0, -300f);
448 else if (keyCode == Input.Keys.BUTTON_X) {
449 if (mutateIconBounds != null) {
450 tap(mutateIconBounds.x, mutateIconBounds.y, 1);
451 }
452 if (flipIconBounds != null) {
453 tap(flipIconBounds.x, flipIconBounds.y, 1);
454 }
455 } else if (keyCode == Input.Keys.BUTTON_Y)
456 fling(0, 300f);
457 return true;
458 }
459 return super.keyDown(keyCode);
460 }
461}

Callers

nothing calls this directly

Calls 4

hasGamepadMethod · 0.95
flingMethod · 0.95
hideZoomMethod · 0.95
tapMethod · 0.95

Tested by

no test coverage detected