keyboard cancel mouse window move/size
authorKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 31 Aug 2019 20:36:00 +0000 (15:36 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 31 Aug 2019 20:36:00 +0000 (15:36 -0500)
src/jexer/TWindow.java

index e0a20734341f3f19405810df7ad3595ff3058a25..58195c915f1ae885485891f159539f53ece7b474 100644 (file)
@@ -608,6 +608,15 @@ public class TWindow extends TWidget {
     @Override
     public void onKeypress(final TKeypressEvent keypress) {
 
+        if (inWindowMove || inWindowResize) {
+            // ESC or ENTER - Exit size/move
+            if (keypress.equals(kbEsc) || keypress.equals(kbEnter)) {
+                inWindowMove = false;
+                inWindowResize = false;
+                return;
+            }
+        }
+
         if (inKeyboardResize) {
 
             // ESC or ENTER - Exit size/move