aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-08-23 22:33:43 -0700
committerKenny Root <kenny@the-b.org>2015-08-23 22:37:16 -0700
commit1c66b6d97b73f3e56b775c2fc505d4b69524fb47 (patch)
tree3850f179b6434d730f54b20e5ea1b4b59bc8697d
parent7e2c347ad188740612478df51e12e7b7c87980a6 (diff)
parente98be2246b94ddf742e7675048fb99409600c9d6 (diff)
downloadconnectbot-1c66b6d97b73f3e56b775c2fc505d4b69524fb47.tar.gz
connectbot-1c66b6d97b73f3e56b775c2fc505d4b69524fb47.tar.bz2
connectbot-1c66b6d97b73f3e56b775c2fc505d4b69524fb47.zip
Merge pull request #134 from alescdb/hscroll-keyboard
-rw-r--r--app/src/main/java/org/connectbot/ConsoleActivity.java229
-rw-r--r--app/src/main/res/layout-large/act_console.xml222
-rw-r--r--app/src/main/res/layout/act_console.xml224
-rw-r--r--app/src/main/res/values/strings.xml33
4 files changed, 569 insertions, 139 deletions
diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java
index 6f72783..2076e1a 100644
--- a/app/src/main/java/org/connectbot/ConsoleActivity.java
+++ b/app/src/main/java/org/connectbot/ConsoleActivity.java
@@ -84,6 +84,7 @@ import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
@@ -99,7 +100,9 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
private static final int CLICK_TIME = 400;
private static final float MAX_CLICK_DISTANCE = 25f;
- private static final int KEYBOARD_DISPLAY_TIME = 1500;
+ private static final int KEYBOARD_DISPLAY_TIME = 3000;
+ private static final int KEYBOARD_REPEAT_INITIAL = 500;
+ private static final int KEYBOARD_REPEAT = 100;
protected ViewPager pager = null;
protected TabLayout tabs = null;
@@ -216,38 +219,143 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
}
};
+ protected Handler keyRepeatHandler = new Handler();
+
+
+ /**
+ * Handle repeatable virtual keys and touch events
+ */
+ public class KeyRepeater implements Runnable, OnTouchListener {
+ private View mView;
+ private Handler mHandler;
+ private boolean mDown;
+
+ public KeyRepeater(Handler handler, View view) {
+ mView = view;
+ mHandler = handler;
+ mView.setOnTouchListener(this);
+ mDown = false;
+ }
+
+ @Override
+ public void run() {
+ mDown = true;
+ mHandler.removeCallbacks(this);
+ mHandler.postDelayed(this, KEYBOARD_REPEAT);
+ onEmulatedKeyClicked(mView);
+ }
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "KeyRepeater.onTouch(" + v.getId() + ", " +
+ event.getAction() + ", " +
+ event.getActionIndex() + ", " +
+ event.getActionMasked() + ");");
+ }
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ mDown = false;
+ mHandler.postDelayed(this, KEYBOARD_REPEAT_INITIAL);
+ return (true);
+
+ case MotionEvent.ACTION_CANCEL:
+ keyRepeatHandler.removeCallbacks(this);
+ return (true);
+
+ case MotionEvent.ACTION_UP:
+ keyRepeatHandler.removeCallbacks(this);
+ if (!mDown) {
+ onEmulatedKeyClicked(mView);
+ }
+ return (true);
+ }
+ return false;
+ }
+ }
+
private void onEmulatedKeyClicked(View v) {
TerminalView terminal = adapter.getCurrentTerminalView();
if (terminal == null) return;
TerminalKeyListener handler = terminal.bridge.getKeyHandler();
- boolean hideKeys = true;
+ boolean hideKeys = false;
- switch (v.getId()) {
+ switch (v.getId()) {
case R.id.button_ctrl:
handler.metaPress(TerminalKeyListener.OUR_CTRL_ON, true);
+ hideKeys = true;
break;
case R.id.button_esc:
handler.sendEscape();
+ hideKeys = true;
break;
case R.id.button_tab:
handler.sendTab();
+ hideKeys = true;
break;
+
case R.id.button_up:
handler.sendPressedKey(vt320.KEY_UP);
- hideKeys = false;
break;
case R.id.button_down:
handler.sendPressedKey(vt320.KEY_DOWN);
- hideKeys = false;
break;
case R.id.button_left:
handler.sendPressedKey(vt320.KEY_LEFT);
- hideKeys = false;
break;
case R.id.button_right:
handler.sendPressedKey(vt320.KEY_RIGHT);
- hideKeys = false;
+ break;
+
+ case R.id.button_home:
+ handler.sendPressedKey(vt320.KEY_HOME);
+ break;
+ case R.id.button_end:
+ handler.sendPressedKey(vt320.KEY_END);
+ break;
+ case R.id.button_pgup:
+ handler.sendPressedKey(vt320.KEY_PAGE_UP);
+ break;
+ case R.id.button_pgdn:
+ handler.sendPressedKey(vt320.KEY_PAGE_DOWN);
+ break;
+
+ case R.id.button_f1:
+ handler.sendPressedKey(vt320.KEY_F1);
+ break;
+ case R.id.button_f2:
+ handler.sendPressedKey(vt320.KEY_F2);
+ break;
+ case R.id.button_f3:
+ handler.sendPressedKey(vt320.KEY_F3);
+ break;
+ case R.id.button_f4:
+ handler.sendPressedKey(vt320.KEY_F4);
+ break;
+ case R.id.button_f5:
+ handler.sendPressedKey(vt320.KEY_F5);
+ break;
+ case R.id.button_f6:
+ handler.sendPressedKey(vt320.KEY_F6);
+ break;
+ case R.id.button_f7:
+ handler.sendPressedKey(vt320.KEY_F7);
+ break;
+ case R.id.button_f8:
+ handler.sendPressedKey(vt320.KEY_F8);
+ break;
+ case R.id.button_f9:
+ handler.sendPressedKey(vt320.KEY_F9);
+ break;
+ case R.id.button_f10:
+ handler.sendPressedKey(vt320.KEY_F10);
+ break;
+ case R.id.button_f11:
+ handler.sendPressedKey(vt320.KEY_F11);
+ break;
+ case R.id.button_f12:
+ handler.sendPressedKey(vt320.KEY_F12);
break;
}
@@ -257,6 +365,9 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
autoHideEmulatedKeys();
terminal.bridge.tryKeyVibrate();
+ if (titleBarHide) {
+ actionBar.hide();
+ }
}
/**
@@ -447,10 +558,29 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
findViewById(R.id.button_ctrl).setOnClickListener(emulatedKeysListener);
findViewById(R.id.button_esc).setOnClickListener(emulatedKeysListener);
findViewById(R.id.button_tab).setOnClickListener(emulatedKeysListener);
- findViewById(R.id.button_up).setOnClickListener(emulatedKeysListener);
- findViewById(R.id.button_down).setOnClickListener(emulatedKeysListener);
- findViewById(R.id.button_left).setOnClickListener(emulatedKeysListener);
- findViewById(R.id.button_right).setOnClickListener(emulatedKeysListener);
+
+ new KeyRepeater(keyRepeatHandler, findViewById(R.id.button_up));
+ new KeyRepeater(keyRepeatHandler, findViewById(R.id.button_down));
+ new KeyRepeater(keyRepeatHandler, findViewById(R.id.button_left));
+ new KeyRepeater(keyRepeatHandler, findViewById(R.id.button_right));
+
+ findViewById(R.id.button_home).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_end).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_pgup).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_pgdn).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f1).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f2).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f3).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f4).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f5).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f6).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f7).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f8).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f9).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f10).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f11).setOnClickListener(emulatedKeysListener);
+ findViewById(R.id.button_f12).setOnClickListener(emulatedKeysListener);
+
actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
@@ -466,6 +596,31 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
}
});
+ if(!hardKeyboard) {
+ // Show virtual keyboard and scroll back and forth
+ final HorizontalScrollView keyboardScroll = (HorizontalScrollView) findViewById(R.id.keyboard_hscroll);
+ showEmulatedKeys();
+ keyboardScroll.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ final int xscroll = findViewById(R.id.button_f12).getRight();
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "smoothScrollBy(toEnd[" + xscroll + "])");
+ }
+ keyboardScroll.smoothScrollBy(xscroll, 0);
+ keyboardScroll.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "smoothScrollBy(toStart[" + (-xscroll) + "])");
+ }
+ keyboardScroll.smoothScrollBy(-xscroll, 0);
+ }
+ }, 1000);
+ }
+ }, 1000);
+ }
+
tabs = (TabLayout) findViewById(R.id.tabs);
if (tabs != null)
tabs.setupWithViewPager(pager);
@@ -787,26 +942,26 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
final View resizeView = inflater.inflate(R.layout.dia_resize, null, false);
new AlertDialog.Builder(ConsoleActivity.this)
- .setView(resizeView)
- .setPositiveButton(R.string.button_resize, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- int width, height;
- try {
- width = Integer.parseInt(((EditText) resizeView
- .findViewById(R.id.width))
- .getText().toString());
- height = Integer.parseInt(((EditText) resizeView
- .findViewById(R.id.height))
- .getText().toString());
- } catch (NumberFormatException nfe) {
- // TODO change this to a real dialog where we can
- // make the input boxes turn red to indicate an error.
- return;
+ .setView(resizeView)
+ .setPositiveButton(R.string.button_resize, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ int width, height;
+ try {
+ width = Integer.parseInt(((EditText) resizeView
+ .findViewById(R.id.width))
+ .getText().toString());
+ height = Integer.parseInt(((EditText) resizeView
+ .findViewById(R.id.height))
+ .getText().toString());
+ } catch (NumberFormatException nfe) {
+ // TODO change this to a real dialog where we can
+ // make the input boxes turn red to indicate an error.
+ return;
+ }
+
+ terminalView.forceSize(width, height);
}
-
- terminalView.forceSize(width, height);
- }
- }).setNegativeButton(android.R.string.cancel, null).create().show();
+ }).setNegativeButton(android.R.string.cancel, null).create().show();
return true;
}
@@ -851,13 +1006,13 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case android.R.id.home:
- Intent intent = new Intent(this, HostListActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- return true;
- default:
- return super.onOptionsItemSelected(item);
+ case android.R.id.home:
+ Intent intent = new Intent(this, HostListActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
}
}
diff --git a/app/src/main/res/layout-large/act_console.xml b/app/src/main/res/layout-large/act_console.xml
index c246bf2..9b02b53 100644
--- a/app/src/main/res/layout-large/act_console.xml
+++ b/app/src/main/res/layout-large/act_console.xml
@@ -142,79 +142,199 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#55000000"
+ android:orientation="horizontal"
android:padding="0dip"
android:visibility="gone">
- <Button
- android:id="@+id/button_ctrl"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_toggle_control_character"
- android:text="@string/button_key_ctrl"/>
+ <HorizontalScrollView
+ android:id="@+id/keyboard_hscroll"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:scrollbars="none">
- <View style="@style/KeyboardSeparator"/>
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:padding="0dp">
- <Button
- android:id="@+id/button_esc"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_send_escape_character"
- android:text="@string/button_key_esc"/>
+ <Button
+ android:id="@+id/button_ctrl"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_toggle_control_character"
+ android:text="@string/button_key_ctrl"/>
+ <View style="@style/KeyboardSeparator"/>
- <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_esc"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_send_escape_character"
+ android:text="@string/button_key_esc"/>
- <Button
- android:id="@+id/button_tab"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_send_tab_character"
- android:text="@string/button_key_tab"/>
+ <View style="@style/KeyboardSeparator"/>
- <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_tab"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_send_tab_character"
+ android:text="@string/button_key_tab"/>
- <Button
- android:id="@+id/button_up"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_up"
- android:text="@string/button_key_up"/>
+ <View style="@style/KeyboardSeparator"/>
- <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_up"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_up"
+ android:text="@string/button_key_up"/>
- <Button
- android:id="@+id/button_down"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_down"
- android:text="@string/button_key_down"/>
+ <View style="@style/KeyboardSeparator"/>
- <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_down"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_down"
+ android:text="@string/button_key_down"/>
- <Button
- android:id="@+id/button_left"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_left"
- android:text="@string/button_key_left"/>
+ <View style="@style/KeyboardSeparator"/>
- <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_left"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_left"
+ android:text="@string/button_key_left"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_right"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_right"
- android:text="@string/button_key_right"/>
+ <Button
+ android:id="@+id/button_right"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_right"
+ android:text="@string/button_key_right"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_home"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_home"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_end"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_end"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_pgup"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_pgup"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_pgdn"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_pgdn"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f1"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f1"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f2"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f2"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f3"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f3"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f4"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f4"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f5"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f5"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f6"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f6"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f7"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f7"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f8"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f8"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f9"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f9"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f10"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f10"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f11"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f11"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f12"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f12"/>
+ </LinearLayout>
+ </HorizontalScrollView>
<View style="@style/KeyboardSeparator"/>
<ImageView
android:id="@+id/button_keyboard"
- android:layout_width="0px"
- android:layout_height="30dip"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:background="#55f0f0f0"
+ style="@style/KeyboardKey"
+ android:background="#55b0b0f0"
android:contentDescription="@string/image_description_show_keyboard"
- android:padding="0dp"
- android:src="@drawable/button_keyboard"
- android:textSize="10dip"
- />
-
+ android:src="@drawable/button_keyboard"/>
</LinearLayout>
</RelativeLayout>
diff --git a/app/src/main/res/layout/act_console.xml b/app/src/main/res/layout/act_console.xml
index 0edae8c..4bc5ccb 100644
--- a/app/src/main/res/layout/act_console.xml
+++ b/app/src/main/res/layout/act_console.xml
@@ -126,79 +126,201 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#55000000"
+ android:orientation="horizontal"
android:padding="0dip"
android:visibility="gone">
- <Button
- android:id="@+id/button_ctrl"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_toggle_control_character"
- android:text="@string/button_key_ctrl"/>
+ <HorizontalScrollView
+ android:id="@+id/keyboard_hscroll"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:scrollbars="none">
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:padding="0dp">
+
+ <Button
+ android:id="@+id/button_ctrl"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_toggle_control_character"
+ android:text="@string/button_key_ctrl"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_esc"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_send_escape_character"
+ android:text="@string/button_key_esc"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_tab"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_send_tab_character"
+ android:text="@string/button_key_tab"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_up"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_up"
+ android:text="@string/button_key_up"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_down"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_down"
+ android:text="@string/button_key_down"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_left"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_left"
+ android:text="@string/button_key_left"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_right"
+ style="@style/KeyboardButton"
+ android:contentDescription="@string/image_description_right"
+ android:text="@string/button_key_right"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_home"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_home"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_end"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_end"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_esc"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_send_escape_character"
- android:text="@string/button_key_esc"/>
+ <Button
+ android:id="@+id/button_pgup"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_pgup"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_tab"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_send_tab_character"
- android:text="@string/button_key_tab"/>
+ <Button
+ android:id="@+id/button_pgdn"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_pgdn"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_up"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_up"
- android:text="@string/button_key_up"/>
+ <Button
+ android:id="@+id/button_f1"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f1"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_down"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_down"
- android:text="@string/button_key_down"/>
+ <Button
+ android:id="@+id/button_f2"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f2"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
- <Button
- android:id="@+id/button_left"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_left"
- android:text="@string/button_key_left"/>
+ <Button
+ android:id="@+id/button_f3"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f3"/>
- <View style="@style/KeyboardSeparator"/>
+ <View style="@style/KeyboardSeparator"/>
+ <Button
+ android:id="@+id/button_f4"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f4"/>
- <Button
- android:id="@+id/button_right"
- style="@style/KeyboardButton"
- android:contentDescription="@string/image_description_right"
- android:text="@string/button_key_right"/>
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f5"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f5"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f6"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f6"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f7"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f7"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f8"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f8"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f9"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f9"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f10"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f10"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f11"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f11"/>
+
+ <View style="@style/KeyboardSeparator"/>
+
+ <Button
+ android:id="@+id/button_f12"
+ style="@style/KeyboardButton"
+ android:text="@string/button_key_f12"/>
+ </LinearLayout>
+ </HorizontalScrollView>
<View style="@style/KeyboardSeparator"/>
<ImageView
android:id="@+id/button_keyboard"
- android:layout_width="0px"
- android:layout_height="30dip"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:background="#55f0f0f0"
+ style="@style/KeyboardKey"
+ android:background="#55b0b0f0"
android:contentDescription="@string/image_description_show_keyboard"
- android:padding="0dp"
- android:src="@drawable/button_keyboard"
- android:textSize="10dip"
- />
-
+ android:src="@drawable/button_keyboard"/>
</LinearLayout>
+
</RelativeLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ecbe757..c6086da 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -555,4 +555,37 @@
<string name="button_key_ctrl">Ctrl</string>
<!-- Text for the "Tab" button in virtual keyboard. -->
<string name="button_key_tab">Tab</string>
+
+ <!-- Text for the "Home" button in virtual keyboard. -->
+ <string name="button_key_home">Home</string>
+ <!-- Text for the "End" button in virtual keyboard. -->
+ <string name="button_key_end">End</string>
+ <!-- Text for the "Page Up" button in virtual keyboard. -->
+ <string name="button_key_pgup">PgUp</string>
+ <!-- Text for the "Page Down" button in virtual keyboard. -->
+ <string name="button_key_pgdn">PgDn</string>
+ <!-- Text for the "F1" button in virtual keyboard. -->
+ <string name="button_key_f1">F1</string>
+ <!-- Text for the "F2" button in virtual keyboard. -->
+ <string name="button_key_f2">F2</string>
+ <!-- Text for the "F3" button in virtual keyboard. -->
+ <string name="button_key_f3">F3</string>
+ <!-- Text for the "F4" button in virtual keyboard. -->
+ <string name="button_key_f4">F4</string>
+ <!-- Text for the "F5" button in virtual keyboard. -->
+ <string name="button_key_f5">F5</string>
+ <!-- Text for the "F6" button in virtual keyboard. -->
+ <string name="button_key_f6">F6</string>
+ <!-- Text for the "F7" button in virtual keyboard. -->
+ <string name="button_key_f7">F7</string>
+ <!-- Text for the "F8" button in virtual keyboard. -->
+ <string name="button_key_f8">F8</string>
+ <!-- Text for the "F9" button in virtual keyboard. -->
+ <string name="button_key_f9">F9</string>
+ <!-- Text for the "F10" button in virtual keyboard. -->
+ <string name="button_key_f10">F10</string>
+ <!-- Text for the "F11" button in virtual keyboard. -->
+ <string name="button_key_f11">F11</string>
+ <!-- Text for the "F12" button in virtual keyboard. -->
+ <string name="button_key_f12">F12</string>
</resources>