Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90e6260d5e | ||
|
|
566d656c16 | ||
|
|
b729085d52 |
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.termux"
|
applicationId "com.termux"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 86
|
versionCode 88
|
||||||
versionName "0.86"
|
versionName "0.88"
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
ndkBuild {
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ final class TermuxPreferences {
|
|||||||
int mBellBehaviour = BELL_VIBRATE;
|
int mBellBehaviour = BELL_VIBRATE;
|
||||||
|
|
||||||
boolean mBackIsEscape;
|
boolean mBackIsEscape;
|
||||||
|
boolean mDisableVolumeVirtualKeys;
|
||||||
boolean mShowExtraKeys;
|
boolean mShowExtraKeys;
|
||||||
|
|
||||||
String[][] mExtraKeys;
|
String[][] mExtraKeys;
|
||||||
@@ -198,6 +199,7 @@ final class TermuxPreferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mBackIsEscape = "escape".equals(props.getProperty("back-key", "back"));
|
mBackIsEscape = "escape".equals(props.getProperty("back-key", "back"));
|
||||||
|
mDisableVolumeVirtualKeys = "volume".equals(props.getProperty("volume-keys", "virtual"));
|
||||||
|
|
||||||
shortcuts.clear();
|
shortcuts.clear();
|
||||||
parseAction("shortcut.create-session", SHORTCUT_ACTION_CREATE_SESSION, props);
|
parseAction("shortcut.create-session", SHORTCUT_ACTION_CREATE_SESSION, props);
|
||||||
|
|||||||
@@ -264,7 +264,9 @@ public final class TermuxViewClient implements TerminalViewClient {
|
|||||||
/** Handle dedicated volume buttons as virtual keys if applicable. */
|
/** Handle dedicated volume buttons as virtual keys if applicable. */
|
||||||
private boolean handleVirtualKeys(int keyCode, KeyEvent event, boolean down) {
|
private boolean handleVirtualKeys(int keyCode, KeyEvent event, boolean down) {
|
||||||
InputDevice inputDevice = event.getDevice();
|
InputDevice inputDevice = event.getDevice();
|
||||||
if (inputDevice != null && inputDevice.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
if (mActivity.mSettings.mDisableVolumeVirtualKeys) {
|
||||||
|
return false;
|
||||||
|
} else if (inputDevice != null && inputDevice.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
||||||
// Do not steal dedicated buttons from a full external keyboard.
|
// Do not steal dedicated buttons from a full external keyboard.
|
||||||
return false;
|
return false;
|
||||||
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
||||||
|
|||||||
@@ -348,10 +348,11 @@ public final class TerminalSession extends TerminalOutput {
|
|||||||
try {
|
try {
|
||||||
final String cwdSymlink = String.format("/proc/%s/cwd/", mShellPid);
|
final String cwdSymlink = String.format("/proc/%s/cwd/", mShellPid);
|
||||||
String outputPath = new File(cwdSymlink).getCanonicalPath();
|
String outputPath = new File(cwdSymlink).getCanonicalPath();
|
||||||
|
String outputPathWithTrailingSlash = outputPath;
|
||||||
if (!outputPath.endsWith("/")) {
|
if (!outputPath.endsWith("/")) {
|
||||||
outputPath += '/';
|
outputPathWithTrailingSlash += '/';
|
||||||
}
|
}
|
||||||
if (!cwdSymlink.equals(outputPath)) {
|
if (!cwdSymlink.equals(outputPathWithTrailingSlash)) {
|
||||||
return outputPath;
|
return outputPath;
|
||||||
}
|
}
|
||||||
} catch (IOException | SecurityException e) {
|
} catch (IOException | SecurityException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user