Merge commit '77d3a60869e7a780c6ae069e51530e1eacece5e2'
[fanfix.git] / src / jexer / event / TKeypressEvent.java
index bdf5e84283ace79ea5b41f75afdb4c2ef8ab3194..79b28f29381655022f879ef0eccd0f472d50307d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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"),
@@ -35,19 +35,18 @@ import jexer.TKeypress;
  */
 public class TKeypressEvent extends TInputEvent {
 
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Keystroke received.
      */
     private TKeypress key;
 
-    /**
-     * Get keystroke.
-     *
-     * @return keystroke
-     */
-    public TKeypress getKey() {
-        return key;
-    }
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
 
     /**
      * Public contructor.
@@ -68,7 +67,7 @@ public class TKeypressEvent extends TInputEvent {
      * @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);
@@ -89,15 +88,9 @@ public class TKeypressEvent extends TInputEvent {
             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.
@@ -147,4 +140,28 @@ public class TKeypressEvent extends TInputEvent {
     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;
+    }
+
 }