changeset 437:208b31032318

fix f11 and f12 keys on full hardware keyboards
author Carl Byington <carl@five-ten-sg.com>
date Fri, 19 Jun 2015 13:41:57 -0700
parents 0dd7fbeba5b1
children d29cce60f393
files src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java src/com/five_ten_sg/connectbot/util/PreferenceConstants.java
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java	Thu Apr 09 11:34:15 2015 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java	Fri Jun 19 13:41:57 2015 -0700
@@ -321,10 +321,7 @@
                 if (k != 0) {
                     if ((orgMetaState & HC_META_CTRL_ON) != 0) {
                         k = keyAsControl(k);
-
-                        if (k != k0)
-                            sendCtrl = true;
-
+                        if (k != k0) sendCtrl = true;
                         // send F1-F10 via CTRL-1 through CTRL-0
                         if (!sendCtrl && sendFunctionKey(keyCode))
                             return true;
@@ -349,10 +346,7 @@
                 if (k != 0) {
                     if ((orgMetaState & HC_META_CTRL_ON) != 0) {
                         k = keyAsControl(k);
-
-                        if (k != k0)
-                            buffer.write(k);
-
+                        if (k != k0) buffer.write(k);
                         return true;
                     }
                     else if ((orgMetaState & KeyEvent.META_ALT_ON) != 0) {
@@ -796,11 +790,11 @@
                 return true;
 
             case KeyEvent.KEYCODE_F11:
-                buffer.keyPressed(vt320.KEY_F10, ' ', 0);
+                buffer.keyPressed(vt320.KEY_F11, ' ', 0);
                 return true;
 
             case KeyEvent.KEYCODE_F12:
-                buffer.keyPressed(vt320.KEY_F10, ' ', 0);
+                buffer.keyPressed(vt320.KEY_F12, ' ', 0);
                 return true;
 
             case KeyEvent.KEYCODE_INSERT:
@@ -1183,7 +1177,7 @@
 
     protected boolean fullKeyboard() {
         if (customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_FULL) ||
-                (customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_ASUS_TF)))
+           (customKeyboard.equals(PreferenceConstants.CUSTOM_KEYMAP_ASUS_TF)))
             return true;
 
         return false;
--- a/src/com/five_ten_sg/connectbot/util/PreferenceConstants.java	Thu Apr 09 11:34:15 2015 -0700
+++ b/src/com/five_ten_sg/connectbot/util/PreferenceConstants.java	Fri Jun 19 13:41:57 2015 -0700
@@ -107,6 +107,7 @@
 
     /* Device keyboard mapping */
     public static final String CUSTOM_KEYMAP = "list_custom_keymap";
+    // must match arrays.xml/list_custom_keymap_values
     public static final String CUSTOM_KEYMAP_DISABLED = "none";
     public static final String CUSTOM_KEYMAP_FULL = "full";
     public static final String CUSTOM_KEYMAP_ASUS_TF = "asus_tf";