Class KeyboardInfo

java.lang.Object
ActiverseEngine.KeyboardInfo
All Implemented Interfaces:
KeyListener, EventListener

public class KeyboardInfo extends Object implements KeyListener
Provides utility methods to retrieve information about keyboard input. This class implements the KeyListener interface to handle keyboard events.
Version:
1.3.2
Author:
Knivier
  • Field Details

    • keys

      public static boolean[] keys
  • 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.
    • keyPressed

      public void keyPressed(KeyEvent e)
      Called when a key is pressed. Updates the state of the corresponding key in the keys array.
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      e - The KeyEvent object representing the key press event.
    • keyReleased

      public void keyReleased(KeyEvent e)
      Called when a key is released. Updates the state of the corresponding key in the keys array.
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - The KeyEvent object representing the key release event.
    • keyTyped

      public void keyTyped(KeyEvent e)
      Called when a key is typed. This method is not used in this class implementation.
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - The KeyEvent object representing the key typed event.