crystalspace.jbind.interfaces.iutil.csinput
Interface iKeyboardDriver

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csKeyboardDriver

public interface iKeyboardDriver
extends iBase

Generic Keyboard Driver. Keyboard driver should generate events and put them into an event queue. Also it tracks the current state of all keys. Typically, one instance of this object is available from the shared-object registry (iObjectRegistry) under the name "crystalspace.driver.input.generic.keyboard".

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiKeyboardDriver.php

Method Summary
 iKeyComposer createKeyComposer()
          Return an instance of the keyboard composer.
 void doKey(int codeRaw, int codeCooked, boolean iDown)
          Call this routine to add a key down/up event to queue.
 void doKey(int codeRaw, int codeCooked, boolean iDown, boolean autoRepeat)
          Call this routine to add a key down/up event to queue.
 void doKey(int codeRaw, int codeCooked, boolean iDown, boolean autoRepeat, int charType)
          Call this routine to add a key down/up event to queue.
 boolean getKeyState(int codeRaw)
          Query the state of a key.
 int getModifierState(int codeRaw)
          Get the current state of the modifiers.
 void reset()
          Call to release all key down flags (when focus switches from application window, for example);.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

createKeyComposer

public iKeyComposer createKeyComposer()
Return an instance of the keyboard composer. Remarks: All composers are independent. Specifically, passing a dead key to one composer won't affect the result after the next keyboard event of any other composer. Implemented in csKeyboardDriver.

Returns:

doKey

public void doKey(int codeRaw,
                  int codeCooked,
                  boolean iDown)
Call this routine to add a key down/up event to queue. Parameters: codeRaw 'Raw' code of the pressed key. codeCooked 'Cooked' code of the pressed key. iDown Whether the key is up or down. autoRepeat Auto-repeat flag for the key event. Typically only used by the platform-specific keyboard agents. charType When the cooked code is a character, it determines whether it is a normal, or dead character. Implemented in csKeyboardDriver.

Parameters:
codeRaw -
codeCooked -
iDown -

doKey

public void doKey(int codeRaw,
                  int codeCooked,
                  boolean iDown,
                  boolean autoRepeat)
Call this routine to add a key down/up event to queue. Parameters: codeRaw 'Raw' code of the pressed key. codeCooked 'Cooked' code of the pressed key. iDown Whether the key is up or down. autoRepeat Auto-repeat flag for the key event. Typically only used by the platform-specific keyboard agents. charType When the cooked code is a character, it determines whether it is a normal, or dead character. Implemented in csKeyboardDriver.

Parameters:
codeRaw -
codeCooked -
iDown -
autoRepeat -

doKey

public void doKey(int codeRaw,
                  int codeCooked,
                  boolean iDown,
                  boolean autoRepeat,
                  int charType)
Call this routine to add a key down/up event to queue. Parameters: codeRaw 'Raw' code of the pressed key. codeCooked 'Cooked' code of the pressed key. iDown Whether the key is up or down. autoRepeat Auto-repeat flag for the key event. Typically only used by the platform-specific keyboard agents. charType When the cooked code is a character, it determines whether it is a normal, or dead character. Implemented in csKeyboardDriver.

Parameters:
codeRaw -
codeCooked -
iDown -
autoRepeat -
charType -

getKeyState

public boolean getKeyState(int codeRaw)
Query the state of a key. All key codes are supported. Returns true if the key is pressed, false if not. Implemented in csKeyboardDriver.

Parameters:
codeRaw -
Returns:

getModifierState

public int getModifierState(int codeRaw)
Get the current state of the modifiers. Implemented in csKeyboardDriver.

Parameters:
codeRaw -
Returns:

reset

public void reset()
Call to release all key down flags (when focus switches from application window, for example);. Implemented in csKeyboardDriver.