|
||||||||||
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.awt.input.AWTKeyInput
public class AWTKeyInput
AWTKeyInput
Field Summary | |
---|---|
(package private) java.util.LinkedList<java.awt.event.KeyEvent> |
events
|
(package private) java.util.BitSet |
keyDown
|
Constructor Summary | |
---|---|
protected |
AWTKeyInput()
|
Method Summary | |
---|---|
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. |
static java.lang.String |
getKeyParam(int key)
getKeyParam returns the KEY_XXXXX param related to the code
given. |
boolean |
isEnabled()
|
boolean |
isKeyDown(int key)
isKeyDown returns true if the given key is pressed. |
void |
keyPressed(java.awt.event.KeyEvent arg0)
|
void |
keyReleased(java.awt.event.KeyEvent arg0)
|
void |
keyTyped(java.awt.event.KeyEvent arg0)
|
void |
setEnabled(boolean enabled)
|
static int |
toAWTCode(int key)
toAWTCode converts KeyInput key codes to AWT key codes. |
static int |
toInputCode(int key)
toInputCode converts AWT key codes to KeyInput 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<java.awt.event.KeyEvent> events
java.util.BitSet keyDown
Constructor Detail |
---|
protected AWTKeyInput()
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 keyTyped(java.awt.event.KeyEvent arg0)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent arg0)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent arg0)
keyReleased
in interface java.awt.event.KeyListener
public static int toAWTCode(int key)
toAWTCode
converts KeyInput key codes to AWT key codes.
key
- jme KeyInput key code
public static java.lang.String getKeyParam(int key)
getKeyParam
returns the KEY_XXXXX param related to the code
given.
key
- jme KeyInput key code
public static int toInputCode(int key)
toInputCode
converts AWT key codes to KeyInput key codes.
key
- awt KeyEvent key code
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 |