public class RememberGameKeyAdapter extends KeyAdapter
KeyAdapter
that tracks detailed information about key events.Modifier and Type | Class and Description |
---|---|
protected class |
RememberGameKeyAdapter.KeyInfo
This class holds the information about one key.
|
Constructor and Description |
---|
RememberGameKeyAdapter() |
Modifier and Type | Method and Description |
---|---|
RememberGameKeyAdapter.KeyInfo |
getExtendedKeyInfo(int keyCode)
Gets the
RememberGameKeyAdapter.KeyInfo for a specific extendedKeyCode |
RememberGameKeyAdapter.KeyInfo |
getKeyInfo(int keyCode)
Gets the
RememberGameKeyAdapter.KeyInfo for a specific keyCode |
boolean |
isAlt()
Call for
isAlt(boolean) with false |
boolean |
isAlt(boolean extended)
Check if alt is down
|
boolean |
isAltGr()
Call for
isAltGr(boolean) with false |
boolean |
isAltGr(boolean extended)
Check if alt_gr is down
|
boolean |
isCtrl()
Call for
isCtrl(boolean) with false |
boolean |
isCtrl(boolean extended)
Check if ctrl is down
|
boolean |
isExtendedKeyDown(int keyCode)
Check, if a key is currently down
|
boolean |
isExtendedKeyUp(int keyCode)
Check, if a key is currently up
|
boolean |
isKeyDown(int keyCode)
Check, if a key is currently down
|
boolean |
isKeyUp(int keyCode)
Check, if a key is currently up
|
boolean |
isShift()
Call for
isShift(boolean) with false |
boolean |
isShift(boolean extended)
Check if shift is down
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
keyTyped
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
keyPressed
in class KeyAdapter
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
keyReleased
in class KeyAdapter
public RememberGameKeyAdapter.KeyInfo getKeyInfo(int keyCode)
RememberGameKeyAdapter.KeyInfo
for a specific keyCodekeyCode
- The keyCodeRememberGameKeyAdapter.KeyInfo
of the keyCodepublic RememberGameKeyAdapter.KeyInfo getExtendedKeyInfo(int keyCode)
RememberGameKeyAdapter.KeyInfo
for a specific extendedKeyCodekeyCode
- The extendedKeyCodeRememberGameKeyAdapter.KeyInfo
of the extendedKeyCodepublic boolean isShift()
isShift(boolean)
with falseisShift(boolean)
public boolean isShift(boolean extended)
KeyEvent.getKeyCode()
- KeyEvent.VK_SHIFT
is
downpublic boolean isAlt()
isAlt(boolean)
with falseisAlt(boolean)
public boolean isAlt(boolean extended)
KeyEvent.getKeyCode()
- KeyEvent.VK_ALT
is
downpublic boolean isAltGr()
isAltGr(boolean)
with falseisAltGr(boolean)
public boolean isAltGr(boolean extended)
KeyEvent.getKeyCode()
- KeyEvent.VK_ALT_GRAPH
is downpublic boolean isCtrl()
isCtrl(boolean)
with falseisCtrl(boolean)
public boolean isCtrl(boolean extended)
KeyEvent.getKeyCode()
- KeyEvent.VK_CONTROL
is downpublic boolean isKeyDown(int keyCode)
keyCode
- Value of #getKeyCode()
public boolean isKeyUp(int keyCode)
keyCode
- Value of #getKeyCode()
public boolean isExtendedKeyDown(int keyCode)
keyCode
- Value of #getExtendedKeyCode()
public boolean isExtendedKeyUp(int keyCode)
keyCode
- Value of #getExtendedKeyCode()
Copyright © 2017. All rights reserved.