Class KeyboardInfo
java.lang.Object
ActiverseEngine.KeyboardInfo
- All Implemented Interfaces:
KeyListener, EventListener
Provides utility methods to retrieve information about keyboard input.
This class implements the KeyListener interface to handle keyboard events.
Supports special keyword "shift" for any shift key.
- Version:
- 1.4.1
- Author:
- Knivier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisKeyDown(int keyCode) Checks if a specific key is currently pressed.static booleanChecks if a specific key is pressed by name (supports special keywords) Special keywords: "shift" for any shift keyvoidCalled when a key is pressed.voidCalled when a key is released.voidCalled when a key is typed.
-
Constructor Details
-
KeyboardInfo
public KeyboardInfo()
-
-
Method Details
-
isKeyDown
public static boolean isKeyDown(int keyCode) Checks if a specific key is currently pressed.- Parameters:
keyCode- The integer code of the key to check.- Returns:
- true if the key is currently pressed, false otherwise.
-
isKeyDown
Checks if a specific key is pressed by name (supports special keywords) Special keywords: "shift" for any shift key- Parameters:
keyName- The name of the key (e.g., "shift")- Returns:
- true if the key is currently pressed
-
keyPressed
Called when a key is pressed. Updates the state of the corresponding key in the keys array.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e- The KeyEvent object representing the key press event.
-
keyReleased
Called when a key is released. Updates the state of the corresponding key in the keys array.- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e- The KeyEvent object representing the key release event.
-
keyTyped
Called when a key is typed. This method is not used in this class implementation.- Specified by:
keyTypedin interfaceKeyListener- Parameters:
e- The KeyEvent object representing the key typed event.
-