summaryrefslogtreecommitdiff
path: root/data/mobileterminal/arrowkeys.diff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2010-03-27 08:04:15 +0000
committerJay Freeman <saurik@saurik.com>2010-03-27 08:04:15 +0000
commitbe0de798fc7927b6a3aaac343230fd724311ce43 (patch)
tree4428e455414af0f8723fb827a5a510c152a3b522 /data/mobileterminal/arrowkeys.diff
parenta94040a7cf28a7ed74a0e54c49d4d7e59bafffd7 (diff)
Added arrow key support to MobileTerminal.
git-svn-id: http://svn.telesphoreo.org/trunk@706 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/mobileterminal/arrowkeys.diff')
-rw-r--r--data/mobileterminal/arrowkeys.diff37
1 files changed, 37 insertions, 0 deletions
diff --git a/data/mobileterminal/arrowkeys.diff b/data/mobileterminal/arrowkeys.diff
new file mode 100644
index 000000000..6f2151475
--- /dev/null
+++ b/data/mobileterminal/arrowkeys.diff
@@ -0,0 +1,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