diff shterm.js @ 76:a497ecd116d9

Improvements to the keyboard. Add a number pad to the keyboard. Make it hidden by default for RLG-Web.
author John "Elwin" Edwards <elwin@sdf.org>
date Sat, 23 Jun 2012 17:11:51 -0700
parents d7eb63cd7a16
children 789c094675f4
line wrap: on
line diff
--- a/shterm.js	Thu Jun 21 23:44:51 2012 -0700
+++ b/shterm.js	Sat Jun 23 17:11:51 2012 -0700
@@ -260,6 +260,10 @@
   ';': "3a", '\'': "22", ',': "3c", '.': "3e", '/': "3f", '`': "7e"
 }
 
+var kpkeys = { "KP1": "1b4f46", "KP2": "1b4f42", "KP3": "1b5b367e", 
+               "KP4": "1b4f44", "KP5": "1b5b45", "KP6": "1b4f43", 
+               "KP7": "1b4f48", "KP8": "1b4f41", "KP9": "1b5b357e" };
+
 function vkey(c) {
   var keystr;
   if (c.match(/^[a-z]$/)) {
@@ -294,6 +298,9 @@
     else
       keystr = c.charCodeAt(0).toString(16);
   }
+  else if (c in kpkeys) {
+    keystr = kpkeys[c];
+  }
   else
     return;
   //writeData("Sending " + keystr);