VT100TerminalView.st
changeset 4293 ade403689ce1
parent 4291 fd935fa1dfec
child 4296 c52538ab6102
--- a/VT100TerminalView.st	Tue Jul 23 16:00:16 2013 +0200
+++ b/VT100TerminalView.st	Tue Jul 23 16:25:04 2013 +0200
@@ -144,6 +144,34 @@
 
 !VT100TerminalView methodsFor:'defaults'!
 
+vt100AlternativeKeyCodes
+    "return the alternative vt100 keyCode table"
+
+    ^ IdentityDictionary withKeysAndValues:
+        #(
+             #CursorUp    '\eOA'
+             #CursorDown  '\eOB'
+             #CursorRight '\eOC'
+             #CursorLeft  '\eOD'
+             #Home        '\eOH'
+             #Escape      '\e'
+             #BackSpace   '\b'
+             #Return      '\r'
+             #Delete      '\0177'
+             #Tab         '\t'
+
+             #F1          '\eOP'
+             #F2          '\eOQ'
+             #F3          '\eOR'
+             #F4          '\eOS'
+             #F5          '\eOt'
+             #F6          '\eOu'
+             #F7          '\eOv'
+             #F8          '\eOl'
+             #F9          '\eOw'
+         )
+!
+
 vt100KeyCodes
     "return a vt100 keyCode table"
 
@@ -153,6 +181,7 @@
              #CursorDown  '\e[B'
              #CursorRight '\e[C'
              #CursorLeft  '\e[D'
+
              #Home        '\e[H'
              #Escape      '\e'
              #BackSpace   '\b'
@@ -935,12 +964,14 @@
         "/ enter application keypad mode
         "/ ESC-=
         alternateKeypadMode := true.
+        kbdSequences := (self vt100AlternativeKeyCodes).
         ^ #sequenceComplete
     ].
     char == $> ifTrue: [
         "/ exit application keypad mode
         "/ ESC-<
         alternateKeypadMode := false.
+        kbdSequences := (self vt100KeyCodes).
         ^ #sequenceComplete
     ].
     ^ #unknown
@@ -1034,10 +1065,10 @@
 !VT100TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.52 2013-07-23 14:00:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.53 2013-07-23 14:25:04 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.52 2013-07-23 14:00:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.53 2013-07-23 14:25:04 cg Exp $'
 ! !