Package de.tum.cit.ase.editor.input
Interface ShortcutAdapter
- All Known Implementing Classes:
Bucket,CanvasInputProcessor,EditorTool,Eraser,Pen,Square,ToolInputAdapter
public interface ShortcutAdapter
The ShortcutAdapter interface defines methods for handling shortcuts in an application.
This interface provides default implementations for adding and removing keys from the set of pressed keys, as well as checking if a given set of keys is a shortcut.
The implementation uses a set of pressed keys to keep track of the keys that are currently being pressed.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddKey(int key) Adds a key to the set of pressed keys.default booleanisShortcut(int... keys) Determines if the given set of keys is a shortcut.default booleanisShortcut(int key, int... modifiers) default booleanisShortcut(Shortcuts.Shortcut shortcut) default voidremoveKey(int key) Removes a key from the set of pressed keys.
-
Field Details
-
pressedKeys
-
-
Method Details
-
isShortcut
default boolean isShortcut(int... keys) Determines if the given set of keys is a shortcut.- Parameters:
keys- the set of keys to check- Returns:
trueif the set of keys is a shortcut,falseotherwise
-
isShortcut
-
isShortcut
default boolean isShortcut(int key, int... modifiers) -
addKey
default void addKey(int key) Adds a key to the set of pressed keys.- Parameters:
key- the key to add
-
removeKey
default void removeKey(int key) Removes a key from the set of pressed keys.- Parameters:
key- the key to remove
-