Package KeyBoard
Class KeyBoardManager
java.lang.Object
KeyBoard.KeyBoardManager
- All Implemented Interfaces:
java.awt.KeyEventDispatcher
public class KeyBoardManager
extends java.lang.Object
implements java.awt.KeyEventDispatcher
manage all supported shortcuts using a list and function pointers.
- Author:
- Itay Finci
-
Field Summary
Fields Modifier and Type Field Description private static intCTRLprivate static intNONEprivate ShapeAdaptersaprivate StackAdapterscprivate static intSHIFT(package private) ShortCut[]shortCuts -
Constructor Summary
Constructors Constructor Description KeyBoardManager(StackController sc)make a new keyboard manager to handle shortcuts -
Method Summary
Modifier and Type Method Description booleandispatchKeyEvent(java.awt.event.KeyEvent e)handle a new key pressed event, check for a shortcutprivate voidinitiateShortCuts()initialize the shortcut list in order to have the defaults loaded
-
Field Details
-
shortCuts
ShortCut[] shortCuts -
sc
-
sa
-
CTRL
private static final int CTRL- See Also:
- Constant Field Values
-
SHIFT
private static final int SHIFT- See Also:
- Constant Field Values
-
NONE
private static final int NONE- See Also:
- Constant Field Values
-
-
Constructor Details
-
KeyBoardManager
make a new keyboard manager to handle shortcuts- Parameters:
sc- the stack controller to connect to
-
-
Method Details
-
initiateShortCuts
private void initiateShortCuts()initialize the shortcut list in order to have the defaults loaded -
dispatchKeyEvent
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e)handle a new key pressed event, check for a shortcut- Specified by:
dispatchKeyEventin interfacejava.awt.KeyEventDispatcher- Parameters:
e- the event- Returns:
- true if the key combination is supported, else false to let the os handle.
-