Skip to content
Snippets Groups Projects
Commit 2992f315 authored by deuce's avatar deuce
Browse files

Add support for abritrary hotkeys.

parent 9ff043a5
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@ if(this.SYS_CLOSED==undefined)
* rpadding: this string is displayed AFTER each item, and is not highlighted
* NOTE: Padding is not included in width
* hblanks: The number of horizontal blanks between items for horizontal menus.
* hotkeys: A string of keys which will immediately return the key value rather
* than a retval
*/
function Lightbar(items)
{
......@@ -60,6 +62,7 @@ function Lightbar(items)
this.lpadding=null;
this.rpadding=null;
this.hblanks=2;
this.hotkeys='';
if(items==undefined)
this.items=new Array();
else
......@@ -312,6 +315,8 @@ function Lightbar_getval(current)
/* Get input */
var key=console.getkey(K_UPPER);
if(this.hotkeys.indexOf(key)!=-1)
return(key);
switch(key) {
case KEY_UP:
if(this.direction==0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment