Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jcontrol.io
Class Keyboard

    java.lang.Object
      jcontrol.io.Keyboard

    public class Keyboard

extends Object

Accesses JControls keyboard. There are two access modes:

- raw access directly reads the keyboard hardware at the time of the method call, use this for polling user reactions.
- buffered access indrictly reads the keyboard via buffer, this mode polls the keyboard in the background automatically and enables automatic keyboard repetition and optional beep on keypress, use this mode for user interfaces and sporadic queries. You can affect beep behaviour using the ``buzzer.keyboardbeep`` property

There are device dependent default keyboard to ASCII maps defined, you can change these at runtime using the second constructor.

Device | Sticker | SmartDisplay | Stamp
Layout |
| '`U`' |
|  | '`u`'
'`S`' |  |
|  | '`d`'
| '`D`' |
| '`U`' |
'`L`' | '`S`' | '`R`'
| '`D`' |
'`S`'
Map | `{'S','u','U','d','D'}` | `{'U','D','L','R','S'}` | `{'S'}`

Constructor Summary
`Keyboard()` Default keyboard initialisation, uses the hard-wired JControl keyboard.

Method Summary
`protected void` | `finalize()` native finalize method
`char` | `getKey()` Buffered keyboard readout.
`char` | `getRaw()` Raw keyboard readout.
`char` | `read()` Default method for reading the keyboard.

Methods inherited from class java.lang.Object
`clone, equals, getClass, notifyAll, toString, wait`

Constructor Detail

### Keyboard

    public Keyboard()

  Default keyboard initialisation, uses the hard-wired JControl keyboard. As there is currently only one keyboard supported per device only one instance is allowed.

Method Detail

### read

    public char read()

  Default method for reading the keyboard. Buffered keyboard readout, enables wait for keypress (this method blocks until keypress), automatic key repetition and keyboard beep (optional).

  Returns:
    the `char` of the pressed key
  See Also:
    `#get()`, `getRaw()`

### getKey

    public char getKey()

  Buffered keyboard readout. Disables wait for keypress (this method does not block), enables automatic key repetition and keyboard beep (optional).

  Returns:
    the `char` of the pressed key or `0` if no key is pressed
  See Also:
    `read()`, `getRaw()`

### getRaw

    public char getRaw()

  Raw keyboard readout. Disables wait for keypress (this method does not block), automatic key repetition and keyboard beep.

  Returns:
    the `char` of the currently pressed key or `0` if no key is pressed

### finalize

    protected void finalize()

  native finalize method

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD