Package nz.ac.vuw.ecs.swen225.gp22.app
Class Keys
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.app.Keys
- All Implemented Interfaces:
KeyListener
,EventListener
- Direct Known Subclasses:
Controller
To map key events to actions.
- Author:
- Molly Henry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
Set keys for actions that happen on pressvoid
Set keys for actions that happen on release
-
Constructor Details
-
Keys
public Keys()
-
-
Method Details
-
setAction
Set keys for actions that happen on release- Parameters:
keyCode
- keycode to setonReleased
- action on releasectrlDown
- should ctrl be pressed
-
setAction
Set keys for actions that happen on press- Parameters:
keyCode
- keycode to setonPressed
- action on press
-
keyTyped
- Specified by:
keyTyped
in interfaceKeyListener
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyListener
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyListener
-