mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-01 23:41:57 +02:00
* Most everything converted to new 'key press' system. Still WIP, some cleanup & probably a few keys to add for various BBS style terminals
This commit is contained in:
parent
dd0568f207
commit
8a17ca694e
13 changed files with 329 additions and 189 deletions
|
@ -62,25 +62,30 @@ SpinnerMenuView.prototype.setFocus = function(focused) {
|
|||
this.redraw();
|
||||
};
|
||||
|
||||
SpinnerMenuView.prototype.onSpecialKeyPress = function(keyName) {
|
||||
|
||||
if(this.isSpecialKeyMapped('up', keyName)) {
|
||||
if(0 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = this.items.length - 1;
|
||||
} else {
|
||||
this.focusedItemIndex--;
|
||||
}
|
||||
} else if(this.isSpecialKeyMapped('down', keyName)) {
|
||||
if(this.items.length - 1 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = 0;
|
||||
} else {
|
||||
this.focusedItemIndex++;
|
||||
SpinnerMenuView.prototype.onKeyPress = function(ch, key) {
|
||||
if(key) {
|
||||
if(this.isSpecialKeyMapped('up', key.name)) {
|
||||
if(0 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = this.items.length - 1;
|
||||
} else {
|
||||
this.focusedItemIndex--;
|
||||
}
|
||||
|
||||
this.updateSelection();
|
||||
return;
|
||||
} else if(this.isSpecialKeyMapped('down', key.name)) {
|
||||
if(this.items.length - 1 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = 0;
|
||||
} else {
|
||||
this.focusedItemIndex++;
|
||||
}
|
||||
|
||||
this.updateSelection();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.updateSelection();
|
||||
|
||||
SpinnerMenuView.super_.prototype.onSpecialKeyPress.call(this, keyName);
|
||||
SpinnerMenuView.super_.prototype.onKeyPress.call(this, ch, key);
|
||||
};
|
||||
|
||||
SpinnerMenuView.prototype.getData = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue