*
* The MIT License (MIT)
*
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
public class TKeypressEvent extends TInputEvent {
+ // ------------------------------------------------------------------------
+ // Variables --------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* Keystroke received.
*/
private TKeypress key;
- /**
- * Get keystroke.
- *
- * @return keystroke
- */
- public TKeypress getKey() {
- return key;
- }
+ // ------------------------------------------------------------------------
+ // Constructors -----------------------------------------------------------
+ // ------------------------------------------------------------------------
/**
* Public contructor.
* @param ctrl if true, CTRL was pressed with this keystroke
* @param shift if true, SHIFT was pressed with this keystroke
*/
- public TKeypressEvent(final boolean isKey, final int fnKey, final char ch,
+ public TKeypressEvent(final boolean isKey, final int fnKey, final int ch,
final boolean alt, final boolean ctrl, final boolean shift) {
this.key = new TKeypress(isKey, fnKey, ch, alt, ctrl, shift);
alt, ctrl, shift);
}
- /**
- * Create a duplicate instance.
- *
- * @return duplicate intance
- */
- public TKeypressEvent dup() {
- TKeypressEvent keypress = new TKeypressEvent(key.dup());
- return keypress;
- }
+ // ------------------------------------------------------------------------
+ // TInputEvent ------------------------------------------------------------
+ // ------------------------------------------------------------------------
/**
* Comparison check. All fields must match to return true.
public String toString() {
return String.format("Keypress: %s", key.toString());
}
+
+ // ------------------------------------------------------------------------
+ // TKeypressEvent ---------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Get keystroke.
+ *
+ * @return keystroke
+ */
+ public TKeypress getKey() {
+ return key;
+ }
+
+ /**
+ * Create a duplicate instance.
+ *
+ * @return duplicate intance
+ */
+ public TKeypressEvent dup() {
+ TKeypressEvent keypress = new TKeypressEvent(key.dup());
+ return keypress;
+ }
+
}