changeset 202:b16288cbad37

configure hardware buttons for showing soft function keypad
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 22:03:34 -0700
parents 621732df242e
children 88c4168cc272
files deployment.connections src/com/five_ten_sg/connectbot/HostListActivity.java src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java src/com/five_ten_sg/connectbot/util/PreferenceConstants.java
diffstat 4 files changed, 95 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/deployment.connections	Wed Jul 02 21:06:28 2014 -0700
+++ b/deployment.connections	Wed Jul 02 22:03:34 2014 -0700
@@ -1,31 +1,93 @@
 #
-# available keys:
+# available host keys:
 #
-# hostkeyalgo
-# hostkey
-# color
-# usekeys
-# useauthagent
-# postlogin
-# pubkeyid
-# wantsession
-# delkey
-# fontsize
-# compression
-# httpproxy
-# encoding
-# stayconnected
-# wantx11forward
-# x11host
-# x11port
-# monitor
-# emulation
-# encryption5250
-# library5250
-# menu5250
-# program5250
+# nickname          (string)
+# color             (string)    ("red", "green", "blue", "gray")
+# fontsize          (float)
+# pubkeyid          (integer)   (-2, -1)    -2=none, -1=any
+# useauthagent      (string)    ("no", "confirm", "yes")
+# postlogin         (string)
+# compression       (boolean)
+# httpproxy         (string)
+# wantsession       (boolean)
+# stayconnected     (boolean)
+# delkey            (string)    ("del", "backspace")
+# encoding          (string)    ("UTF-8", etc)
+# username          (string)
+# hostname          (string)
+# port              (integer)
+# monitor           (string)
+# emulation         (string)    ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen", or other answerback string)
+# encryption5250    (string)
+# library5250       (string)
+# menu5250          (string)
+# program5250       (string)
+# wantx11forward    (boolean)
+# x11host           (string)
+# x11port           (integer)
 
 
 tn5250://pub1.rzkh.de:23#battleship
     encryption5250=NONE
+    fontsize=12.5
 
+
+#
+# global settings are under global:// tag
+#
+# available global keys:
+#
+#   memkeys                     (boolean)
+#   update                      (string) ("Daily", "Weekly", "Never")
+#   connPersist                 (boolean)
+#   emulation                   (string) ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen")
+#   scrollback                  (integer)
+#   rotation                    (string) ("Default", "Force landscape", "Force portrait", "Automatic")
+#   shiftfkeys                  (boolean)
+#   ctrlfkeys                   (boolean)
+#   volumefont                  (boolean)
+#   keymode                     (string) ("Use right-side keys", "Use left-side keys", "none")
+#   camera                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "None")
+#   volup                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "None")
+#   voldn                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "None")
+#   search                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "None")
+#   ptt                         (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "None")
+#   keepalive                   (boolean)
+#   wifilock                    (boolean)
+#   bumpyarrows                 (boolean)
+#   extended_longpress          (boolean)
+#   ctrl_string                 (string)
+#   picker_string               (string)
+#   picker_keep_open            (boolean)
+#   list_custom_keymap          (string)    ("none", "full", "asus_tf", "sgh_i927", "sgh_i927_ics", "se_xppro")
+#   bell                        (boolean)
+#   bellVolume                  (float)
+#   bellVibrate                 (boolean)
+#   bellNotification            (boolean)
+#   default_font_size           (float)
+#   default_fsize_width         (integer)
+#   default_fsize_height        (integer)
+#   screen_capture_folder       (string)
+#   screen_capture_popup        (boolean)
+#   file_dialog                 (string)
+#   download_folder             (string)
+#   remote_upload_folder        (string)
+#   upload_dest_prompt          (boolean)
+#   background_file_transfer    (boolean)
+#   debug_keycodes              (boolean)
+#
+
+global://
+    update=Never
+    emulation=xterm-256color
+    scrollback=200
+    rotation=Force landscape
+    camera=None
+    volup=Soft Function Keypad
+    voldn=Tab
+    search=None
+    ptt=Monitor Key
+    default_font_size=12.5
+
+#
+# end
--- a/src/com/five_ten_sg/connectbot/HostListActivity.java	Wed Jul 02 21:06:28 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/HostListActivity.java	Wed Jul 02 22:03:34 2014 -0700
@@ -458,34 +458,8 @@
                     types.put("debug_keycodes", "boolean");
                     for (String key : values.keySet()) {
                         if (types.containsKey(key)) {
-                            //char stype = types.get(key).charAt(0);
-                            char stype = 's';
-                            switch (stype) {
-                                case 'b':
-                                    boolean bx = prefs.getBoolean(key, true);
-                                    boolean bv = values.getAsBoolean(key);
-                                    editor.putBoolean(key, bv);
-                                    break;
-
-                                case 'i':
-                                    int ix = prefs.getInt(key, 0);
-                                    int iv = values.getAsInteger(key);
-                                    editor.putInt(key, iv);
-                                    break;
-
-                                case 'f':
-                                    String fsx = prefs.getString(key, "");
-                                    //float fx = prefs.getFloat(key, 1.0f);
-                                    float fv = values.getAsFloat(key);
-                                    editor.putFloat(key, fv);
-                                    break;
-
-                                case 's':
-                                    String sx = prefs.getString(key, "");
-                                    String sv = values.getAsString(key);
-                                    editor.putString(key, sv);
-                                    break;
-                            }
+                            String sv = values.getAsString(key);
+                            editor.putString(key, sv);
                         }
                     }
                     editor.commit();
--- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java	Wed Jul 02 21:06:28 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java	Wed Jul 02 22:03:34 2014 -0700
@@ -609,7 +609,12 @@
     }
 
     private boolean handleShortcut(View v, String shortcut, int repeat, boolean down) {
-        if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) {
+        if (PreferenceConstants.HWBUTTON_FUNCTION_KEYS.equals(shortcut)) {
+            if (repeat > 0) return false;
+            if (!down) return false;
+            bridge.showFKeysDialog();
+        }
+        else if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) {
             if (repeat > 0) return false;
             if (!down) return false;
             bridge.captureScreen();
--- a/src/com/five_ten_sg/connectbot/util/PreferenceConstants.java	Wed Jul 02 21:06:28 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/util/PreferenceConstants.java	Wed Jul 02 22:03:34 2014 -0700
@@ -71,6 +71,7 @@
     public static final String HWBUTTON_CTRLA = "Ctrl+A";
     public static final String HWBUTTON_ESC_A = "Esc+A";
     public static final String HWBUTTON_MONITOR = "Monitor Key";
+    public static final String HWBUTTON_FUNCTION_KEYS = "Soft Function Keypad";
     public static final String HWBUTTON_NONE = "None";
 
     public static final String KEEP_ALIVE = "keepalive";