X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fevent%2FTKeypressEvent.java;h=79b28f29381655022f879ef0eccd0f472d50307d;hb=505be508ae7d3fb48122be548b310a238cfb91eb;hp=32a1615888334439d9d515fdfd9c08c9909bbac7;hpb=3e0743556d1f31723a11a6019b5c2b018b4b2104;p=fanfix.git diff --git a/src/jexer/event/TKeypressEvent.java b/src/jexer/event/TKeypressEvent.java index 32a1615..79b28f2 100644 --- a/src/jexer/event/TKeypressEvent.java +++ b/src/jexer/event/TKeypressEvent.java @@ -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"), @@ -33,21 +33,20 @@ import jexer.TKeypress; /** * This class encapsulates a keyboard input event. */ -public final class TKeypressEvent extends TInputEvent { +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 final 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 final 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 final 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; + } + }