Commits

Anonymous committed a11e188

Use latest yoob.LineInputBuffer.

  • Participants
  • Parent commits 9762d8e

Comments (0)

Files changed (2)

File impl/swl.js/demo/swl.html

   <title>SUPER WUMPUS LAND</title>
   <style>
 #terminal {
-    background: black;
+  background: black;
+  border: 5px solid black;
 }
   </style>
 </head>

File impl/swl.js/src/yoob/line-input-buffer.js

                     }
                 }
                 e.cancelBubble = true;
+                e.preventDefault();
                 break;
               case 13:  /* Enter */
                 if (me.terminal !== undefined) {
                 }
                 me.text = "";
                 e.cancelBubble = true;
+                e.preventDefault();
                 break;
               case 38:  /* Up arrow */
                 break;
 
         /* TODO support on more browsers, with keyup */
         listenObject.addEventListener('keypress', function(e) {
-            if (e.charCode === 0) return;
+            if (e.charCode === 0 || e.charCode === 13 || e.charCode === 8) {
+                return;
+            }
             //alert('keypress:' + e.charCode);
             if (e.altKey) {
                 //alert(e.charCode);
                 me.onupdate(me.text);
             }
             e.cancelBubble = true;
+            e.preventDefault();
         }, true);
 
         return this;