summaryrefslogtreecommitdiff
path: root/data/mobileterminal/arrowkeys.diff
blob: 6f215147562202287a3d9fbe74499b0693beb5ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -ru mobileterminal-364/Sources/MobileTerminal.m mobileterminal-364+iPhone/Sources/MobileTerminal.m
--- mobileterminal-364/Sources/MobileTerminal.m	2009-04-26 07:55:26.000000000 +0000
+++ mobileterminal-364+iPhone/Sources/MobileTerminal.m	2010-03-26 05:01:43.000000000 +0000
@@ -212,12 +212,27 @@
 - (void)handleKeyPress:(unichar)c
 {
     if (!controlKeyMode) {
-        if (c == 0x2022) {
-            controlKeyMode = YES;
-            return;
-        } else if (c == 0x0a) // LF from keyboard RETURN
-        {
-            c = 0x0d; // convert to CR
+        switch (c) {
+            case 0x2022:
+                controlKeyMode = YES;
+                return;
+
+            case '\n':
+                c = '\r';
+            break;
+
+            case 0xf700:
+                [self.activeTerminal.process write:"\x1b[A" length:3];
+                return;
+            case 0xf701:
+                [self.activeTerminal.process write:"\x1b[B" length:3];
+                return;
+            case 0xf702:
+                [self.activeTerminal.process write:"\x1b[D" length:3];
+                return;
+            case 0xf703:
+                [self.activeTerminal.process write:"\x1b[C" length:3];
+                return;
         }
     } else {
         // was in ctrl key mode, got another key