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

Method addKeyboardHandler

src/main/java/field/graphics/Window.java:680–683  ·  view source on GitHub ↗

A keyboard handler is a Function , Boolean>>, that is a function that takes a transition between two KeyboardStates and returns a boolean, whether or not it ever wants to be called again

(Function<Event<KeyboardState>, Boolean> h)

Source from the content-addressed store, hash-verified

678 */
679 @HiddenInAutocomplete
680 public void fireMouseTransition(MouseState before, MouseState after) {
681 after.keyboardState = keyboardState;
682
683 if ((after.mods & GLFW_MOD_SHIFT) != 0)
684 after.keyboardState = after.keyboardState.withKey(GLFW_KEY_LEFT_SHIFT, true);
685 else after.keyboardState = after.keyboardState.withKey(GLFW_KEY_LEFT_SHIFT, false)
686 .withKey(GLFW_KEY_RIGHT_SHIFT, false);

Callers 7

OpenMethod · 0.80
installMethod · 0.80
OSXWindowTricksMethod · 0.80
LinuxWindowTricksMethod · 0.80
loadedMethod · 0.80
attachToWindowMethod · 0.80
KeyboardCameraMethod · 0.80

Calls 1

addMethod · 0.45

Tested by

no test coverage detected