aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/mud/terminal
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-06-15 22:08:03 +0000
committerKenny Root <kenny@the-b.org>2009-06-15 22:08:03 +0000
commit157b17bc041925d7a187f90e7a352dd915823c48 (patch)
tree89842dc07a97800631776e940be8f2447c46e368 /src/de/mud/terminal
parentd5945e821483477ca23f4998f8f310c53ccba2ab (diff)
downloadconnectbot-157b17bc041925d7a187f90e7a352dd915823c48.tar.gz
connectbot-157b17bc041925d7a187f90e7a352dd915823c48.tar.bz2
connectbot-157b17bc041925d7a187f90e7a352dd915823c48.zip
Add configurable backspace key
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@303 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src/de/mud/terminal')
-rw-r--r--src/de/mud/terminal/vt320.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/de/mud/terminal/vt320.java b/src/de/mud/terminal/vt320.java
index 0e92523..e962400 100644
--- a/src/de/mud/terminal/vt320.java
+++ b/src/de/mud/terminal/vt320.java
@@ -206,7 +206,12 @@ public void setScreenSize(int c, int r, boolean broadcast) {
BackSpace[2] = "\u0018"; // VMS control deletes line back
BackSpace[0] = BackSpace[3] = "\u007f"; // VMS other is delete
} else {
- BackSpace[0] = BackSpace[1] = BackSpace[2] = BackSpace[3] = "\b";
+ //BackSpace[0] = BackSpace[1] = BackSpace[2] = BackSpace[3] = "\b";
+ // ConnectBot modifications.
+ BackSpace[0] = "\b";
+ BackSpace[1] = "\u007f";
+ BackSpace[2] = "\u001b[3~";
+ BackSpace[3] = "\u001b[2~";
}
/* some more VT100 keys */
@@ -286,6 +291,19 @@ public void setScreenSize(int c, int r, boolean broadcast) {
NUMDot[0] = ".";
}
+ public void setBackspace(int type) {
+ switch (type) {
+ case DELETE_IS_DEL:
+ BackSpace[0] = "\u007f";
+ BackSpace[1] = "\b";
+ break;
+ case DELETE_IS_BACKSPACE:
+ BackSpace[0] = "\b";
+ BackSpace[1] = "\u007f";
+ break;
+ }
+ }
+
/**
* Create a default vt320 terminal with 80 columns and 24 lines.
*/
@@ -648,6 +666,9 @@ public void setScreenSize(int c, int r, boolean broadcast) {
public final static int KEY_ADD = 42;
public final static int KEY_ESCAPE = 43;
+ public final static int DELETE_IS_DEL = 0;
+ public final static int DELETE_IS_BACKSPACE = 1;
+
/* The graphics charsets
* B - default ASCII
* A - ISO Latin 1