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 int CTRL  
    private static int NONE  
    private ShapeAdapter sa  
    private StackAdapter sc  
    private static int SHIFT  
    (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
    boolean dispatchKeyEvent​(java.awt.event.KeyEvent e)
    handle a new key pressed event, check for a shortcut
    private void initiateShortCuts()
    initialize the shortcut list in order to have the defaults loaded

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • KeyBoardManager

      public KeyBoardManager​(StackController sc)
      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:
      dispatchKeyEvent in interface java.awt.KeyEventDispatcher
      Parameters:
      e - the event
      Returns:
      true if the key combination is supported, else false to let the os handle.