File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
app/src/main/java/com/termux/app Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ final static class KeyboardShortcut {
66
66
int mBellBehaviour = BELL_VIBRATE ;
67
67
68
68
boolean mBackIsEscape ;
69
+ boolean mDisableVolumeVirtualKeys ;
69
70
boolean mShowExtraKeys ;
70
71
71
72
String [][] mExtraKeys ;
@@ -198,6 +199,7 @@ void reloadFromProperties(Context context) {
198
199
}
199
200
200
201
mBackIsEscape = "escape" .equals (props .getProperty ("back-key" , "back" ));
202
+ mDisableVolumeVirtualKeys = "volume" .equals (props .getProperty ("volume-keys" , "virtual" ));
201
203
202
204
shortcuts .clear ();
203
205
parseAction ("shortcut.create-session" , SHORTCUT_ACTION_CREATE_SESSION , props );
Original file line number Diff line number Diff line change @@ -264,7 +264,9 @@ public boolean onLongPress(MotionEvent event) {
264
264
/** Handle dedicated volume buttons as virtual keys if applicable. */
265
265
private boolean handleVirtualKeys (int keyCode , KeyEvent event , boolean down ) {
266
266
InputDevice inputDevice = event .getDevice ();
267
- if (inputDevice != null && inputDevice .getKeyboardType () == InputDevice .KEYBOARD_TYPE_ALPHABETIC ) {
267
+ if (mActivity .mSettings .mDisableVolumeVirtualKeys ) {
268
+ return false ;
269
+ } else if (inputDevice != null && inputDevice .getKeyboardType () == InputDevice .KEYBOARD_TYPE_ALPHABETIC ) {
268
270
// Do not steal dedicated buttons from a full external keyboard.
269
271
return false ;
270
272
} else if (keyCode == KeyEvent .KEYCODE_VOLUME_DOWN ) {
You can’t perform that action at this time.
0 commit comments