Autocompelte

This commit is contained in:
Devine Lu Linvega
2017-06-08 15:47:31 -10:00
parent 56d5dfc976
commit 43ea3bd386
3 changed files with 44 additions and 1 deletions

View File

@@ -14,6 +14,16 @@ function Keyboard()
if(event.altKey == true){
this.alt_held = true;
}
// Autocomplete with tab
if(event.keyCode === 9){
var ac = ronin.terminal.find_autocomplete();
if(ac){
event.preventDefault();
ronin.terminal.input.value += ac;
}
}
ronin.cursor.update(event);
ronin.widget.update();
ronin.terminal.update();
@@ -24,6 +34,8 @@ function Keyboard()
this.shift_held = false;
this.alt_held = false;
event.preventDefault();
switch (event.key || event.keyCode || event.which) {
case "Enter": this.key_enter(); break;
case "ArrowUp": this.key_arrow_up(); break;
@@ -44,6 +56,8 @@ function Keyboard()
case 8: this.key_delete(); break;
}
console.log(event)
// Passive
ronin.widget.update();
ronin.terminal.update();