Class Keyboard


  • public class Keyboard
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Keyboard()
      Deprecated.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean closeInterfaceWithESC()  
      static Keyboard getKeyboard()
      Deprecated.
      static double getWordsPerMinute()  
      static void holdKey​(char character, Condition c, long timeout)
      Holds a given key until either the condition is met or until the given time has passed This method spawns a new thread
      static void holdShift​(Condition c)
      Holds shift until either the condition is met or until 3 seconds have passed STARTS A NEW THREAD
      static void holdShift​(Condition c, long timeout)
      Holds shift until either the condition is met or until the given time has passed STARTS A NEW THREAD
      static void holdSpace​(Condition c, long timeout)
      Holds the space bar until either the condition is met or until the given time has passed This method spawns a new thread
      static boolean isHoldingShift()  
      static boolean isTyping()  
      static void pressShift()  
      static void releaseShift()  
      static void setHoldingShift​(boolean holdingShift)  
      static void setTypeEventOpen​(boolean open)
      static void setWordsPerMinute​(double wordsPerMinute)  
      static void type​(java.lang.Object message)
      Types a message and presses enter
      static void type​(java.lang.Object message, boolean enter)
      Types a message and presses enter depending on parameters
      static void type​(java.lang.Object message, boolean enter, boolean makeMistakes)
      Types a message and presses enter depending on parameters
      static void typeSpecialKey​(int key)
      Types a special key, such as F keys.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Keyboard

        @Deprecated
        public Keyboard()
        Deprecated.
    • Method Detail

      • getKeyboard

        @Deprecated
        public static Keyboard getKeyboard()
        Deprecated.
      • closeInterfaceWithESC

        public static boolean closeInterfaceWithESC()
      • type

        public static void type​(java.lang.Object message)
        Types a message and presses enter
        Parameters:
        message - message to type
      • type

        public static void type​(java.lang.Object message,
                                boolean enter)
        Types a message and presses enter depending on parameters
        Parameters:
        message - message to type
        enter - true to press enter at the end
      • type

        public static void type​(java.lang.Object message,
                                boolean enter,
                                boolean makeMistakes)
        Types a message and presses enter depending on parameters
        Parameters:
        message - message to type
        enter - true to press enter at the end
      • isTyping

        public static boolean isTyping()
      • typeSpecialKey

        public static void typeSpecialKey​(int key)
        Types a special key, such as F keys.
        Parameters:
        key - KeyEvent.VK_F1, etc
      • setTypeEventOpen

        public static void setTypeEventOpen​(boolean open)
      • holdShift

        public static void holdShift​(Condition c)
        Holds shift until either the condition is met or until 3 seconds have passed STARTS A NEW THREAD
        Parameters:
        c - Condition used to signify when to let go of shift
      • holdShift

        public static void holdShift​(Condition c,
                                     long timeout)
        Holds shift until either the condition is met or until the given time has passed STARTS A NEW THREAD
        Parameters:
        c - Condition used to signify when to let go of shift
        timeout - Timeout in case Condition is never met
      • holdKey

        public static void holdKey​(char character,
                                   Condition c,
                                   long timeout)
        Holds a given key until either the condition is met or until the given time has passed This method spawns a new thread
        Parameters:
        c - Condition used to signify when to let go of key
        timeout - Timeout in case Condition is never met
      • holdSpace

        public static void holdSpace​(Condition c,
                                     long timeout)
        Holds the space bar until either the condition is met or until the given time has passed This method spawns a new thread
        Parameters:
        c - Condition used to signify when to let go of space
        timeout - Timeout in case Condition is never met
      • pressShift

        public static void pressShift()
      • releaseShift

        public static void releaseShift()
      • isHoldingShift

        public static boolean isHoldingShift()
      • setHoldingShift

        public static void setHoldingShift​(boolean holdingShift)
      • getWordsPerMinute

        public static double getWordsPerMinute()
      • setWordsPerMinute

        public static void setWordsPerMinute​(double wordsPerMinute)