KVM

Package | Class | Use | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.epiphan.vga2usb
Class KVM

    Object
      com.epiphan.vga2usb.KVM

public class KVM
extends Object

KVM wrapper for a KVM-enabled grabber. Keyboard scan codes defined in this class implement a subset of so-called Scan Code Set 2, which is the default scan code set for all modern keyboards.

Since:
  3.20.15
See Also:
  http://www.computer-engineering.org/ps2keyboard

Nested Class Summary
`static class` | `KVM.Key` Standard PS/2 scancode descriptor.

Field Summary
`static KVM.Key` | `KEY_0` `0x45 - 0xF0,0x45`
`static KVM.Key` | `KEY_1` `0x16 - 0xF0,0x16`
`static KVM.Key` | `KEY_2` `0x1E - 0xF0,0x1E`
`static KVM.Key` | `KEY_3` `0x26 - 0xF0,0x26`
`static KVM.Key` | `KEY_4` `0x25 - 0xF0,0x25`
`static KVM.Key` | `KEY_5` `0x2E - 0xF0,0x2E`
`static KVM.Key` | `KEY_6` `0x36 - 0xF0,0x36`
`static KVM.Key` | `KEY_7` `0x3D - 0xF0,0x3D`
`static KVM.Key` | `KEY_8` `0x3E - 0xF0,0x3E`
`static KVM.Key` | `KEY_9` `0x46 - 0xF0,0x46`
`static KVM.Key` | `KEY_A` `0x1C - 0xF0,0x1C`
`static KVM.Key` | `KEY_ADD` `0x79 - 0xF0,0x79`
`static KVM.Key` | `KEY_ALT` `0x11 - 0xF0,0x11`
`static KVM.Key` | `KEY_B` `0x32 - 0xF0,0x32`
`static KVM.Key` | `KEY_BACK_QUOTE` `0x0E - 0xF0,0x0E`
`static KVM.Key` | `KEY_BACK_SLASH` `0x5D - 0xF0,0x5D`
`static KVM.Key` | `KEY_BACK_SPACE` `0x66 - 0xF0,0x66`
`static KVM.Key` | `KEY_C` `0x21 - 0xF0,0x21`
`static KVM.Key` | `KEY_CAPS_LOCK` `0x58 - 0xF0,0x58`
`static KVM.Key` | `KEY_CLOSE_BRACKET` `0x5B - 0xF0,0x5B`
`static KVM.Key` | `KEY_COMMA` `0x41 - 0xF0,0x41`
`static KVM.Key` | `KEY_CONTROL` `0x14 - 0xF0,0x14`
`static KVM.Key` | `KEY_D` `0x23 - 0xF0,0x23`
`static KVM.Key` | `KEY_DECIMAL` `0x71 - 0xF0,0x71`
`static KVM.Key` | `KEY_DELETE` `0xE0,0x71 - 0xE0,0xF0,0x71`
`static KVM.Key` | `KEY_DIVIDE` `0xE0,0x4A - 0xE0,0xF0,0x4A`
`static KVM.Key` | `KEY_DOWN` `0xE0,0x72 - 0xE0,0xF0,0x72`
`static KVM.Key` | `KEY_E` `0x24 - 0xF0,0x24`
`static KVM.Key` | `KEY_END` `0xE0,0x69 - 0xE0,0xF0,0x69`
`static KVM.Key` | `KEY_ENTER` `0x5A - 0xF0,0x5A`
`static KVM.Key` | `KEY_EQUALS` `0x55 - 0xF0,0x55`
`static KVM.Key` | `KEY_ESCAPE` `0x76 - 0xF0,0x76`
`static KVM.Key` | `KEY_F` `0x2B - 0xF0,0x2B`
`static KVM.Key` | `KEY_F1` `0x05 - 0xF0,0x05`
`static KVM.Key` | `KEY_F10` `0x09 - 0xF0,0x09`
`static KVM.Key` | `KEY_F11` `0x78 - 0xF0,0x78`
`static KVM.Key` | `KEY_F12` `0x07 - 0xF0,0x07`
`static KVM.Key` | `KEY_F2` `0x06 - 0xF0,0x06`
`static KVM.Key` | `KEY_F3` `0x04 - 0xF0,0x04`
`static KVM.Key` | `KEY_F4` `0x0C - 0xF0,0x0C`
`static KVM.Key` | `KEY_F5` `0x03 - 0xF0,0x03`
`static KVM.Key` | `KEY_F6` `0x0B - 0xF0,0x0B`
`static KVM.Key` | `KEY_F7` `0x83 - 0xF0,0x83`
`static KVM.Key` | `KEY_F8` `0x0A - 0xF0,0x0A`
`static KVM.Key` | `KEY_F9` `0x01 - 0xF0,0x01`
`static KVM.Key` | `KEY_G` `0x34 - 0xF0,0x34`
`static KVM.Key` | `KEY_H` `0x33 - 0xF0,0x33`
`static KVM.Key` | `KEY_HOME` `0xE0,0x6C - 0xE0,0xF0,0x6C`
`static KVM.Key` | `KEY_I` `0x43 - 0xF0,0x43`
`static KVM.Key` | `KEY_INSERT` `0xE0,0x70 - 0xE0,0xF0,0x70`
`static KVM.Key` | `KEY_J` `0x3B - 0xF0,0x3B`
`static KVM.Key` | `KEY_K` `0x42 - 0xF0,0x42`
`static KVM.Key` | `KEY_L` `0x4B - 0xF0,0x4B`
`static KVM.Key` | `KEY_LEFT` `0xE0,0x6B - 0xE0,0xF0,0x6B`
`static KVM.Key` | `KEY_M` `0x3A - 0xF0,0x3A`
`static KVM.Key` | `KEY_MINUS` `0x4E - 0xF0,0x4E`
`static KVM.Key` | `KEY_MULTIPLY` `0x7C - 0xF0,0x7C`
`static KVM.Key` | `KEY_N` `0x31 - 0xF0,0x31`
`static KVM.Key` | `KEY_NUM_LOCK` `0x77 - 0xF0,0x77`
`static KVM.Key` | `KEY_NUMPAD0` `0x70 - 0xF0,0x70`
`static KVM.Key` | `KEY_NUMPAD1` `0x69 - 0xF0,0x69`
`static KVM.Key` | `KEY_NUMPAD2` `0x72 - 0xF0,0x72`
`static KVM.Key` | `KEY_NUMPAD3` `0x7A - 0xF0,0x7A`
`static KVM.Key` | `KEY_NUMPAD4` `0x6B - 0xF0,0x6B`
`static KVM.Key` | `KEY_NUMPAD5` `0x73 - 0xF0,0x73`
`static KVM.Key` | `KEY_NUMPAD6` `0x74 - 0xF0,0x74`
`static KVM.Key` | `KEY_NUMPAD7` `0x6C - 0xF0,0x6C`
`static KVM.Key` | `KEY_NUMPAD8` `0x75 - 0xF0,0x75`
`static KVM.Key` | `KEY_NUMPAD9` `0x7D - 0xF0,0x7D`
`static KVM.Key` | `KEY_O` `0x44 - 0xF0,0x44`
`static KVM.Key` | `KEY_OPEN_BRACKET` `0x54 - 0xF0,0x54`
`static KVM.Key` | `KEY_P` `0x4D - 0xF0,0x4D`
`static KVM.Key` | `KEY_PAGE_DOWN` `0xE0,0x7A - 0xE0,0xF0,0x7A`
`static KVM.Key` | `KEY_PAGE_UP` `0xE0,0x7D - 0xE0,0xF0,0x7D`
`static KVM.Key` | `KEY_PERIOD` `0x49 - 0xF0,0x49`
`static KVM.Key` | `KEY_Q` `0x15 - 0xF0,0x15`
`static KVM.Key` | `KEY_QUOTE` `0x52 - 0xF0,0x52`
`static KVM.Key` | `KEY_R` `0x2D - 0xF0,0x2D`
`static KVM.Key` | `KEY_RIGHT` `0xE0,0x74 - 0xE0,0xF0,0x74`
`static KVM.Key` | `KEY_S` `0x1B - 0xF0,0x1B`
`static KVM.Key` | `KEY_SEMICOLON` `0x4C - 0xF0,0x4C`
`static KVM.Key` | `KEY_SHIFT` `0x12 - 0xF0,0x12`
`static KVM.Key` | `KEY_SLASH` `0x4A - 0xF0,0x4A`
`static KVM.Key` | `KEY_SPACE` `0x29 - 0xF0,0x29`
`static KVM.Key` | `KEY_SUBTRACT` `0x7B - 0xF0,0x7B`
`static KVM.Key` | `KEY_T` `0x2C - 0xF0,0x2C`
`static KVM.Key` | `KEY_TAB` `0x0D - 0xF0,0x0D`
`static KVM.Key` | `KEY_U` `0x3C - 0xF0,0x3C`
`static KVM.Key` | `KEY_UP` `0xE0,0x75 - 0xE0,0xF0,0x75`
`static KVM.Key` | `KEY_V` `0x2A - 0xF0,0x2A`
`static KVM.Key` | `KEY_W` `0x1D - 0xF0,0x1D`
`static KVM.Key` | `KEY_X` `0x22 - 0xF0,0x22`
`static KVM.Key` | `KEY_Y` `0x35 - 0xF0,0x35`
`static KVM.Key` | `KEY_Z` `0x1A - 0xF0,0x1A`

Constructor Summary
`KVM(Grabber g)` Creates KVM wrapper for the specified grabber.

Method Summary
`static KVM.Key` | `findKey(int vk)` Finds the scancode descriptor for the specified virtual key code.
`void` | `reset()` Generates mouse and keyboard reset sequence.
`void` | `resetKeyboard()` Generates keyboard reset sequence.
`void` | `resetMouse()` Generates mouse reset sequence.
`boolean` | `sendKeyEvent(int vk, boolean down)` Generates a single keyboard event.
`void` | `sendKeyEvent(KVM.Key key, boolean down)` Generates a single keyboard event.
`void` | `sendMouseEvent(int dx, int dy, boolean left, boolean right)` Generates a single mouse event.

Methods inherited from class Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### KEY_0

    public static final KVM.Key KEY_0

  `0x45 - 0xF0,0x45`

### KEY_1

    public static final KVM.Key KEY_1

  `0x16 - 0xF0,0x16`

### KEY_2

    public static final KVM.Key KEY_2

  `0x1E - 0xF0,0x1E`

### KEY_3

    public static final KVM.Key KEY_3

  `0x26 - 0xF0,0x26`

### KEY_4

    public static final KVM.Key KEY_4

  `0x25 - 0xF0,0x25`

### KEY_5

    public static final KVM.Key KEY_5

  `0x2E - 0xF0,0x2E`

### KEY_6

    public static final KVM.Key KEY_6

  `0x36 - 0xF0,0x36`

### KEY_7

    public static final KVM.Key KEY_7

  `0x3D - 0xF0,0x3D`

### KEY_8

    public static final KVM.Key KEY_8

  `0x3E - 0xF0,0x3E`

### KEY_9

    public static final KVM.Key KEY_9

  `0x46 - 0xF0,0x46`

### KEY_A

    public static final KVM.Key KEY_A

  `0x1C - 0xF0,0x1C`

### KEY_ADD

    public static final KVM.Key KEY_ADD

  `0x79 - 0xF0,0x79`

### KEY_ALT

    public static final KVM.Key KEY_ALT

  `0x11 - 0xF0,0x11`

### KEY_B

    public static final KVM.Key KEY_B

  `0x32 - 0xF0,0x32`

### KEY_BACK_QUOTE

    public static final KVM.Key KEY_BACK_QUOTE

  `0x0E - 0xF0,0x0E`

### KEY_BACK_SLASH

    public static final KVM.Key KEY_BACK_SLASH

  `0x5D - 0xF0,0x5D`

### KEY_BACK_SPACE

    public static final KVM.Key KEY_BACK_SPACE

  `0x66 - 0xF0,0x66`

### KEY_C

    public static final KVM.Key KEY_C

  `0x21 - 0xF0,0x21`

### KEY_CAPS_LOCK

    public static final KVM.Key KEY_CAPS_LOCK

  `0x58 - 0xF0,0x58`

### KEY_CLOSE_BRACKET

    public static final KVM.Key KEY_CLOSE_BRACKET

  `0x5B - 0xF0,0x5B`

### KEY_COMMA

    public static final KVM.Key KEY_COMMA

  `0x41 - 0xF0,0x41`

### KEY_CONTROL

    public static final KVM.Key KEY_CONTROL

  `0x14 - 0xF0,0x14`

### KEY_D

    public static final KVM.Key KEY_D

  `0x23 - 0xF0,0x23`

### KEY_DECIMAL

    public static final KVM.Key KEY_DECIMAL

  `0x71 - 0xF0,0x71`

### KEY_DELETE

    public static final KVM.Key KEY_DELETE

  `0xE0,0x71 - 0xE0,0xF0,0x71`

### KEY_DIVIDE

    public static final KVM.Key KEY_DIVIDE

  `0xE0,0x4A - 0xE0,0xF0,0x4A`

### KEY_DOWN

    public static final KVM.Key KEY_DOWN

  `0xE0,0x72 - 0xE0,0xF0,0x72`

### KEY_E

    public static final KVM.Key KEY_E

  `0x24 - 0xF0,0x24`

### KEY_END

    public static final KVM.Key KEY_END

  `0xE0,0x69 - 0xE0,0xF0,0x69`

### KEY_ENTER

    public static final KVM.Key KEY_ENTER

  `0x5A - 0xF0,0x5A`

### KEY_EQUALS

    public static final KVM.Key KEY_EQUALS

  `0x55 - 0xF0,0x55`

### KEY_ESCAPE

    public static final KVM.Key KEY_ESCAPE

  `0x76 - 0xF0,0x76`

### KEY_F

    public static final KVM.Key KEY_F

  `0x2B - 0xF0,0x2B`

### KEY_F1

    public static final KVM.Key KEY_F1

  `0x05 - 0xF0,0x05`

### KEY_F10

    public static final KVM.Key KEY_F10

  `0x09 - 0xF0,0x09`

### KEY_F11

    public static final KVM.Key KEY_F11

  `0x78 - 0xF0,0x78`

### KEY_F12

    public static final KVM.Key KEY_F12

  `0x07 - 0xF0,0x07`

### KEY_F2

    public static final KVM.Key KEY_F2

  `0x06 - 0xF0,0x06`

### KEY_F3

    public static final KVM.Key KEY_F3

  `0x04 - 0xF0,0x04`

### KEY_F4

    public static final KVM.Key KEY_F4

  `0x0C - 0xF0,0x0C`

### KEY_F5

    public static final KVM.Key KEY_F5

  `0x03 - 0xF0,0x03`

### KEY_F6

    public static final KVM.Key KEY_F6

  `0x0B - 0xF0,0x0B`

### KEY_F7

    public static final KVM.Key KEY_F7

  `0x83 - 0xF0,0x83`

### KEY_F8

    public static final KVM.Key KEY_F8

  `0x0A - 0xF0,0x0A`

### KEY_F9

    public static final KVM.Key KEY_F9

  `0x01 - 0xF0,0x01`

### KEY_G

    public static final KVM.Key KEY_G

  `0x34 - 0xF0,0x34`

### KEY_H

    public static final KVM.Key KEY_H

  `0x33 - 0xF0,0x33`

### KEY_HOME

    public static final KVM.Key KEY_HOME

  `0xE0,0x6C - 0xE0,0xF0,0x6C`

### KEY_I

    public static final KVM.Key KEY_I

  `0x43 - 0xF0,0x43`

### KEY_INSERT

    public static final KVM.Key KEY_INSERT

  `0xE0,0x70 - 0xE0,0xF0,0x70`

### KEY_J

    public static final KVM.Key KEY_J

  `0x3B - 0xF0,0x3B`

### KEY_K

    public static final KVM.Key KEY_K

  `0x42 - 0xF0,0x42`

### KEY_L

    public static final KVM.Key KEY_L

  `0x4B - 0xF0,0x4B`

### KEY_LEFT

    public static final KVM.Key KEY_LEFT

  `0xE0,0x6B - 0xE0,0xF0,0x6B`

### KEY_M

    public static final KVM.Key KEY_M

  `0x3A - 0xF0,0x3A`

### KEY_MINUS

    public static final KVM.Key KEY_MINUS

  `0x4E - 0xF0,0x4E`

### KEY_MULTIPLY

    public static final KVM.Key KEY_MULTIPLY

  `0x7C - 0xF0,0x7C`

### KEY_N

    public static final KVM.Key KEY_N

  `0x31 - 0xF0,0x31`

### KEY_NUM_LOCK

    public static final KVM.Key KEY_NUM_LOCK

  `0x77 - 0xF0,0x77`

### KEY_NUMPAD0

    public static final KVM.Key KEY_NUMPAD0

  `0x70 - 0xF0,0x70`

### KEY_NUMPAD1

    public static final KVM.Key KEY_NUMPAD1

  `0x69 - 0xF0,0x69`

### KEY_NUMPAD2

    public static final KVM.Key KEY_NUMPAD2

  `0x72 - 0xF0,0x72`

### KEY_NUMPAD3

    public static final KVM.Key KEY_NUMPAD3

  `0x7A - 0xF0,0x7A`

### KEY_NUMPAD4

    public static final KVM.Key KEY_NUMPAD4

  `0x6B - 0xF0,0x6B`

### KEY_NUMPAD5

    public static final KVM.Key KEY_NUMPAD5

  `0x73 - 0xF0,0x73`

### KEY_NUMPAD6

    public static final KVM.Key KEY_NUMPAD6

  `0x74 - 0xF0,0x74`

### KEY_NUMPAD7

    public static final KVM.Key KEY_NUMPAD7

  `0x6C - 0xF0,0x6C`

### KEY_NUMPAD8

    public static final KVM.Key KEY_NUMPAD8

  `0x75 - 0xF0,0x75`

### KEY_NUMPAD9

    public static final KVM.Key KEY_NUMPAD9

  `0x7D - 0xF0,0x7D`

### KEY_O

    public static final KVM.Key KEY_O

  `0x44 - 0xF0,0x44`

### KEY_OPEN_BRACKET

    public static final KVM.Key KEY_OPEN_BRACKET

  `0x54 - 0xF0,0x54`

### KEY_P

    public static final KVM.Key KEY_P

  `0x4D - 0xF0,0x4D`

### KEY_PAGE_DOWN

    public static final KVM.Key KEY_PAGE_DOWN

  `0xE0,0x7A - 0xE0,0xF0,0x7A`

### KEY_PAGE_UP

    public static final KVM.Key KEY_PAGE_UP

  `0xE0,0x7D - 0xE0,0xF0,0x7D`

### KEY_PERIOD

    public static final KVM.Key KEY_PERIOD

  `0x49 - 0xF0,0x49`

### KEY_Q

    public static final KVM.Key KEY_Q

  `0x15 - 0xF0,0x15`

### KEY_QUOTE

    public static final KVM.Key KEY_QUOTE

  `0x52 - 0xF0,0x52`

### KEY_R

    public static final KVM.Key KEY_R

  `0x2D - 0xF0,0x2D`

### KEY_RIGHT

    public static final KVM.Key KEY_RIGHT

  `0xE0,0x74 - 0xE0,0xF0,0x74`

### KEY_S

    public static final KVM.Key KEY_S

  `0x1B - 0xF0,0x1B`

### KEY_SEMICOLON

    public static final KVM.Key KEY_SEMICOLON

  `0x4C - 0xF0,0x4C`

### KEY_SHIFT

    public static final KVM.Key KEY_SHIFT

  `0x12 - 0xF0,0x12`

### KEY_SLASH

    public static final KVM.Key KEY_SLASH

  `0x4A - 0xF0,0x4A`

### KEY_SPACE

    public static final KVM.Key KEY_SPACE

  `0x29 - 0xF0,0x29`

### KEY_SUBTRACT

    public static final KVM.Key KEY_SUBTRACT

  `0x7B - 0xF0,0x7B`

### KEY_T

    public static final KVM.Key KEY_T

  `0x2C - 0xF0,0x2C`

### KEY_TAB

    public static final KVM.Key KEY_TAB

  `0x0D - 0xF0,0x0D`

### KEY_U

    public static final KVM.Key KEY_U

  `0x3C - 0xF0,0x3C`

### KEY_UP

    public static final KVM.Key KEY_UP

  `0xE0,0x75 - 0xE0,0xF0,0x75`

### KEY_V

    public static final KVM.Key KEY_V

  `0x2A - 0xF0,0x2A`

### KEY_W

    public static final KVM.Key KEY_W

  `0x1D - 0xF0,0x1D`

### KEY_X

    public static final KVM.Key KEY_X

  `0x22 - 0xF0,0x22`

### KEY_Y

    public static final KVM.Key KEY_Y

  `0x35 - 0xF0,0x35`

### KEY_Z

    public static final KVM.Key KEY_Z

  `0x1A - 0xF0,0x1A`

Constructor Detail

### KVM

    public KVM(Grabber g)

  Creates KVM wrapper for the specified grabber. The grabber must be KVM capable.

Parameters:
  `g` - the grabber for which to create KVM wrapper.
Throws:
  `IllegalArgumentException` - if grabber is not KVM capable.

Method Detail

### findKey

    public static KVM.Key findKey(int vk)

  Finds the scancode descriptor for the specified virtual key code.

  Parameters:
    `vk` - virtual key code.
  Returns:
    matching Key object, `null` if not found.

### reset

    public void reset()
               throws IOException

  Generates mouse and keyboard reset sequence.

  Throws:
    `IOException` - if an I/O error occurs.

### resetKeyboard

    public void resetKeyboard()
                       throws IOException

  Generates keyboard reset sequence.

  Throws:
    `IOException` - if an I/O error occurs.

### resetMouse

    public void resetMouse()
                    throws IOException

  Generates mouse reset sequence.

  Throws:
    `IOException` - if an I/O error occurs.

### sendKeyEvent

    public boolean sendKeyEvent(int vk,
                                boolean down)
                         throws IOException

  Generates a single keyboard event.

  Parameters:
    `vk` - virtual key code from a `KeyEvent`
    `down` - `true` if the key is pressed, `false` if it was released
  Returns:
    `true` if PS/2 scancode was found for this virtual key code, `false` otherwise.
  Throws:
    `IOException` - if an I/O error occurs
  See Also:
    `KeyEvent`

### sendKeyEvent

    public void sendKeyEvent(KVM.Key key,
                             boolean down)
                      throws IOException

  Generates a single keyboard event.

  Parameters:
    `key` - the key code
    `down` - `true` if the key is pressed, `false` if it was released.
  Throws:
    `IOException` - if an I/O error occurs

### sendMouseEvent

    public void sendMouseEvent(int dx,
                               int dy,
                               boolean left,
                               boolean right)
                        throws IOException

  Generates a single mouse event.

  Parameters:
    `dx` - horizontal amount.
    `dy` - vertical amount.
    `left` - `true` if left button is pressed.
    `right` - `true` if right button is pressed.
  Throws:
    `IOException` - if an I/O error occurs.

Package | Class | Use | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 Epiphan Systems Inc. All rights reserved.