mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-09 12:04:03 +08:00
feat for - ―
This commit is contained in:
committed by
Fredrik Fornwall
parent
2e53ef038e
commit
f2f7f963e6
@@ -71,6 +71,9 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
case "↓":
|
case "↓":
|
||||||
keyCode = KeyEvent.KEYCODE_DPAD_DOWN;
|
keyCode = KeyEvent.KEYCODE_DPAD_DOWN;
|
||||||
break;
|
break;
|
||||||
|
case "―":
|
||||||
|
chars = "-";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
chars = keyName;
|
chars = keyName;
|
||||||
}
|
}
|
||||||
@@ -150,7 +153,7 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
removeAllViews();
|
removeAllViews();
|
||||||
|
|
||||||
String[][] buttons = {
|
String[][] buttons = {
|
||||||
{"ESC", "/", "-", "HOME", "↑", "END", "PGUP"},
|
{"ESC", "/", "―", "HOME", "↑", "END", "PGUP"},
|
||||||
{"TAB", "CTRL", "ALT", "←", "↓", "→", "PGDN"}
|
{"TAB", "CTRL", "ALT", "←", "↓", "→", "PGDN"}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -227,10 +230,10 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
if ("-/".contains(buttonText)) {
|
if ("―/".contains(buttonText)) {
|
||||||
if (popupWindow == null && event.getY() < 0) {
|
if (popupWindow == null && event.getY() < 0) {
|
||||||
v.setBackgroundColor(BUTTON_COLOR);
|
v.setBackgroundColor(BUTTON_COLOR);
|
||||||
String text = "-".equals(buttonText) ? "|" : "\\";
|
String text = "―".equals(buttonText) ? "|" : "\\";
|
||||||
popup(v, text);
|
popup(v, text);
|
||||||
}
|
}
|
||||||
if (popupWindow != null && event.getY() > 0) {
|
if (popupWindow != null && event.getY() > 0) {
|
||||||
@@ -248,11 +251,11 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
scheduledExecutor = null;
|
scheduledExecutor = null;
|
||||||
}
|
}
|
||||||
if (longPressCount == 0) {
|
if (longPressCount == 0) {
|
||||||
if (popupWindow != null && "-/".contains(buttonText)) {
|
if (popupWindow != null && "―/".contains(buttonText)) {
|
||||||
popupWindow.setContentView(null);
|
popupWindow.setContentView(null);
|
||||||
popupWindow.dismiss();
|
popupWindow.dismiss();
|
||||||
popupWindow = null;
|
popupWindow = null;
|
||||||
sendKey(root, "-".equals(buttonText) ? "|" : "\\");
|
sendKey(root, "―".equals(buttonText) ? "|" : "\\");
|
||||||
} else {
|
} else {
|
||||||
v.performClick();
|
v.performClick();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user