Share this page

com.hp.lft.sdk

## Class Keyboard

- java.lang.Object
- - com.hp.lft.sdk.Keyboard

-     public class Keyboard
      extends java.lang.Object

  A class that enables low-level keyboard operations.
  When working in a grid configuration, use DesktopEnvironment.getKeyboard to get the KeyboardDevice object, which enables keyboard operations on a specific environment or grid node.

- - ### Nested Class Summary

    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Keyboard.Keys`

  - ### Constructor Summary

    Constructor and Description
    `Keyboard()`

  - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `static void` | `keyDown(byte keyScanCode)` Deprecated. use `keyDown(Keys)` instead.
    `static void` | `keyDown(Keyboard.Keys key)` Presses and holds the specified key using a keyboard virtual key.
    `static void` | `keyUp(byte keyScanCode)` Deprecated. use `keyUp(Keys)` instead.
    `static void` | `keyUp(Keyboard.Keys key)` Releases the specified key based on its keyboard virtual key.
    `static void` | `pressKey(byte keyScanCode)` Deprecated. use `pressKey(Keys)` instead.
    `static void` | `pressKey(Keyboard.Keys key)` Presses the specified key using a keyboard virtual key.
    `static void` | `sendString(java.lang.String stringToSend)` Types the specified string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Keyboard

          public Keyboard()

  - ### Method Detail

    - #### pressKey

          @Deprecated
          public static void pressKey(byte keyScanCode)
                                            throws GeneralLeanFtException

      Deprecated. use `pressKey(Keys)` instead.
      Presses the specified key using a keyboard scan code.
      Supports the PS/2 Keyboard scan code set 1.
      Parameters:
        `keyScanCode` - the keyboard scan code of the key.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pressKey

          public static void pressKey(Keyboard.Keys key)
                               throws GeneralLeanFtException

      Presses the specified key using a keyboard virtual key.
      Parameters:
        `key` - the keyboard code of the key. Possible values: `Keyboard.Keys`
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### keyDown

          @Deprecated
          public static void keyDown(byte keyScanCode)
                                           throws GeneralLeanFtException

      Deprecated. use `keyDown(Keys)` instead.
      Presses and holds the specified key using a keyboard scan code.
      Supports the PS/2 Keyboard scan code set 1.
      Parameters:
        `keyScanCode` - the keyboard scan code of the key to hold.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### keyDown

          public static void keyDown(Keyboard.Keys key)
                              throws GeneralLeanFtException

      Presses and holds the specified key using a keyboard virtual key.
      Parameters:
        `key` - the keyboard code of the key to hold. Possible values: `Keyboard.Keys`
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### keyUp

          @Deprecated
          public static void keyUp(byte keyScanCode)
                                         throws GeneralLeanFtException

      Deprecated. use `keyUp(Keys)` instead.
      Releases the specified key based on its keyboard scan code.
      Supports the PS/2 Keyboard scan code set 1.
      Parameters:
        `keyScanCode` - the keyboard scan code of the key to release.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### keyUp

          public static void keyUp(Keyboard.Keys key)
                            throws GeneralLeanFtException

      Releases the specified key based on its keyboard virtual key.
      Parameters:
        `key` - the keyboard code of the key to release. Possible values: `Keyboard.Keys`
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### sendString

          public static void sendString(java.lang.String stringToSend)
                                 throws GeneralLeanFtException

      Types the specified string.
      Parameters:
        `stringToSend` - the string to type.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: