From: Kevin Lamonte Date: Sat, 31 Aug 2019 20:36:00 +0000 (-0500) Subject: keyboard cancel mouse window move/size X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=1aff59b62f29796a10834bc2e054d75b5d902c5e;p=nikiroo-utils.git keyboard cancel mouse window move/size --- diff --git a/src/jexer/TWindow.java b/src/jexer/TWindow.java index e0a2073..58195c9 100644 --- a/src/jexer/TWindow.java +++ b/src/jexer/TWindow.java @@ -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