From 28eb872d986d326d79b04e2dd83568d98e9e9915 Mon Sep 17 00:00:00 2001 From: NikolaBabic <nab701@usask.ca> Date: Thu, 4 Mar 2021 18:01:57 -0600 Subject: [PATCH] Added Hotkey class --- src/model/Hotkey.java | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/model/Hotkey.java diff --git a/src/model/Hotkey.java b/src/model/Hotkey.java new file mode 100644 index 0000000..563b82f --- /dev/null +++ b/src/model/Hotkey.java @@ -0,0 +1,53 @@ +package model; + +import java.io.Serializable; + +public class Hotkey { + /** + * Virtual keycode of the hotkey. + */ + protected final int keyCode; + + /** + * Unique ID of the hotkey. + */ + protected final int id; + + /** + * Modifier for the hotkey. + */ + protected final Modifier modifier; + + /** + * Constructs an immutable hotkey. + * @param keyCode The virtual keycode of the hotkey. + * @param id The unique ID of the hotkey. + * @param modifier The modifier of the hotkey. + */ + public Hotkey(int keyCode, int id, Modifier modifier) { + this.keyCode = keyCode; + this.id = id; + this.modifier = modifier; + } + + /** + * Gets the Hotkeys virtual keyCode. + */ + public int getKeyCode() { + return keyCode; + } + + /** + * Gets the hotkey's unique ID. + */ + public int getID() { + return id; + } + + /** + * Get's the hotkey's modifier. + */ + public Modifier getModifier() { + return modifier; + } +} -- GitLab