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
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addKey
(int key) Adds a key to the set of pressed keys.default boolean
isShortcut
(int... keys) Determines if the given set of keys is a shortcut.default boolean
isShortcut
(int key, int... modifiers) default boolean
isShortcut
(Shortcuts.Shortcut shortcut) default void
removeKey
(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:
true
if the set of keys is a shortcut,false
otherwise
-
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
-