From e25e316bf44fc72bf31c93a2d2a00b765ec0c837 Mon Sep 17 00:00:00 2001 From: Jonas Hermsmeier Date: Wed, 28 Jun 2017 15:47:21 +0200 Subject: [PATCH] keyboard: Prevent input focus loss if no completion found This prevents the command line input from losing focus when Tab is hit, but there was no command completion found. --- scripts/core/keyboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/core/keyboard.js b/scripts/core/keyboard.js index 58f360f..0f96cb6 100644 --- a/scripts/core/keyboard.js +++ b/scripts/core/keyboard.js @@ -17,9 +17,9 @@ function Keyboard() // Autocomplete with tab if(event.keyCode === 9){ + event.preventDefault(); var ac = ronin.terminal.find_autocomplete(); if(ac){ - event.preventDefault(); ronin.terminal.input.value += ac; } } @@ -105,7 +105,7 @@ function Keyboard() this.key_escape = function() { ronin.overlay.key_escape(); - + for(var key in ronin.modules){ ronin.modules[key].key_escape(); }