Interface KeyboardTypingAlgorithm

  • All Known Implementing Classes:
    StandardKeyboardAlgorithm

    public interface KeyboardTypingAlgorithm
    Interface for keyboard typing algorithm/behavior of the client. Used for the implementation of KeyboardEvent KeyboardEvent.run() will continuously call handleTyping if there is a message to type, or typeKey if only a singular Key is set to be typed The KeyboardEvent will continuously check for its own timeout, completed/failed conditions. Those do not need to be handled here. It is recommended to only type one key at a type in the handleTyping and returning 1 The message to be typed is truncated by the number you return in that method. This is handled inside KeyboardEvent eg: handleTyping("test") return 1 followed by handleTyping("est") return 1 followed by handleTyping("st") return 2 completed
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int handleTyping​(java.lang.String message)
      Handles typing of characters Intended use is to type one character at a type, but not a requirement Message will be truncated as per the number of characters typed before being re-called Enter is called separately if message is completed successfully
      void pressEnter()
      Handles pressing enter, called when the message has been typed successfully if required
      void typeKey​(Key key)
      Handles typing of a singular Key If you require typing a character that is not in the Key list, the key events are able to send the raw character NOTE - the internal information of the event will not be correct if we do not have the key information for it.
    • Method Detail

      • handleTyping

        int handleTyping​(java.lang.String message)
        Handles typing of characters Intended use is to type one character at a type, but not a requirement Message will be truncated as per the number of characters typed before being re-called Enter is called separately if message is completed successfully
        Parameters:
        message - Message to type, recommended to handle only 1 character (not including shift) before returning
        Returns:
        number of keys typed (not including Shift)
      • typeKey

        void typeKey​(Key key)
        Handles typing of a singular Key If you require typing a character that is not in the Key list, the key events are able to send the raw character NOTE - the internal information of the event will not be correct if we do not have the key information for it.
        Parameters:
        key -
      • pressEnter

        void pressEnter()
        Handles pressing enter, called when the message has been typed successfully if required