jcontrol.io
Class Keyboard

java.lang.Object
  extended by jcontrol.io.Keyboard

public class Keyboard
extends Object

Accesses JControls keyboard. There are two access modes:

There are device dependent default keyboard to ASCII maps defined, you can change these at runtime using the second constructor.
DeviceStickerPCWatchStamp
Layout
'U'
'u'
'S'
'd'
'D'
'U'
'L''S''R'
'D'
'S'
Map{'S','u','U','d','D'} {'U','D','L','R','S'}{'S'}

Author:
Marcus Timmermann, Andreas Wesseler, Helge Böhme
Available on JControl Devices:
all

Constructor Summary
Keyboard()
          Default keyboard initialisation, uses the hard-wired JControl keyboard.
Keyboard(char[] keymap)
          Keyboard initialisation, assigns a custom keymap to this Keyboard.
 
Method Summary
 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, notifyAll, 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.


Keyboard

public Keyboard(char[] keymap)
Keyboard initialisation, assigns a custom keymap to this Keyboard. As there is currently only one keyboard supported per device only one instance is allowed.

Parameters:
keymap - array of characters containing all key labels; set to null for default keymap
Method Detail

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

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()