|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.input.Input
com.jme.input.KeyInput
com.jmex.swt.input.SWTKeyInput
public class SWTKeyInput
Note: portions originally from the jme-swt source.
Field Summary | |
---|---|
(package private) java.util.LinkedList<org.eclipse.swt.events.KeyEvent> |
events
|
(package private) java.util.BitSet |
keyDown
|
Constructor Summary | |
---|---|
protected |
SWTKeyInput()
|
Method Summary | |
---|---|
(package private) static java.lang.String |
character(char character)
|
void |
clear()
|
void |
clearKey(int keycode)
|
protected void |
destroy()
destroy frees the keyboard for use by other applications. |
int |
getKeyIndex(java.lang.String name)
The reverse of getKeyName, returns the value of the key given the name |
java.lang.String |
getKeyName(int key)
getKeyName returns the string prepresentation of a
key code. |
(package private) static java.lang.String |
getKeyText(int keyCode)
|
boolean |
isEnabled()
|
boolean |
isKeyDown(int key)
isKeyDown returns true if the given key is pressed. |
void |
keyPressed(org.eclipse.swt.events.KeyEvent arg0)
|
void |
keyReleased(org.eclipse.swt.events.KeyEvent arg0)
|
void |
setEnabled(boolean enabled)
|
static int |
toInputCode(int key)
toInputCode converts SWT key codes to KeyInput key codes. |
static int |
toSWTCode(int key)
toSWTCode converts KeyInput key codes to SWT key codes. |
void |
update()
Updates the current state of the keyboard, holding information about what keys are pressed. |
Methods inherited from class com.jme.input.KeyInput |
---|
addListener, containsListener, destroyIfInitalized, get, getListeners, getProvider, isControlDown, isInited, isShiftDown, removeListener, removeListeners, setProvider, setProvider |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.LinkedList<org.eclipse.swt.events.KeyEvent> events
java.util.BitSet keyDown
Constructor Detail |
---|
protected SWTKeyInput()
Method Detail |
---|
public boolean isKeyDown(int key)
KeyInput
isKeyDown
returns true if the given key is pressed. False
otherwise.
isKeyDown
in class KeyInput
key
- the keycode to check for.
public java.lang.String getKeyName(int key)
KeyInput
getKeyName
returns the string prepresentation of a
key code.
getKeyName
in class KeyInput
key
- the key code to check.
public int getKeyIndex(java.lang.String name)
KeyInput
getKeyIndex
in class KeyInput
public void update()
KeyInput
update
in class KeyInput
protected void destroy()
KeyInput
destroy
frees the keyboard for use by other applications.
Destroy is protected now - please is KeyInput.destroyIfInitalized()
.
destroy
in class KeyInput
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- The enabled to set.public void keyPressed(org.eclipse.swt.events.KeyEvent arg0)
keyPressed
in interface org.eclipse.swt.events.KeyListener
public void keyReleased(org.eclipse.swt.events.KeyEvent arg0)
keyReleased
in interface org.eclipse.swt.events.KeyListener
public static int toSWTCode(int key)
toSWTCode
converts KeyInput key codes to SWT key codes.
key
- jme KeyInput key code
public static int toInputCode(int key)
toInputCode
converts SWT key codes to KeyInput key codes.
key
- swt KeyEvent key code
static java.lang.String getKeyText(int keyCode)
static java.lang.String character(char character)
public void clear()
clear
in class KeyInput
public void clearKey(int keycode)
clearKey
in class KeyInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |