Package KeyBoard

Class ShortCut

java.lang.Object
KeyBoard.ShortCut

public class ShortCut
extends java.lang.Object
wrap a single shortcut - the keys that will activate it and the function that will be called
Author:
Itay Finci
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.function.Function<java.lang.Object,​java.lang.Object> function  
    protected int key  
    protected int modifier  
  • Constructor Summary

    Constructors 
    Constructor Description
    ShortCut​(int key, int modifier, java.util.function.Function<java.lang.Object,​java.lang.Object> function)
    create a new shortcut
  • Method Summary

    Modifier and Type Method Description
    void run​(java.lang.Object o)
    run the function on action requested

    Methods inherited from class java.lang.Object

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

    • key

      protected int key
    • modifier

      protected int modifier
    • function

      protected java.util.function.Function<java.lang.Object,​java.lang.Object> function
  • Constructor Details

    • ShortCut

      public ShortCut​(int key, int modifier, java.util.function.Function<java.lang.Object,​java.lang.Object> function)
      create a new shortcut
      Parameters:
      key - the key that will activate the shortcut
      modifier - the modifies that required for this shortcut
      function - the function that will be called when the shortcut is requested
  • Method Details

    • run

      public void run​(java.lang.Object o)
      run the function on action requested
      Parameters:
      o - the object that is passed with the action