mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-08 18:11:10 +01:00
Fixed: Ensure FN extra key is read by the terminal
Can't find info on why it wasn't being read before
This commit is contained in:
parent
9117240961
commit
d1478fb6c3
4 changed files with 17 additions and 1 deletions
|
|
@ -599,6 +599,7 @@ public final class TerminalView extends View {
|
|||
final boolean controlDown = event.isCtrlPressed() || mClient.readControlKey();
|
||||
final boolean leftAltDown = (metaState & KeyEvent.META_ALT_LEFT_ON) != 0 || mClient.readAltKey();
|
||||
final boolean shiftDown = event.isShiftPressed() || mClient.readShiftKey();
|
||||
final boolean fnDown = event.isFunctionPressed() || mClient.readFnKey();
|
||||
final boolean rightAltDownFromEvent = (metaState & KeyEvent.META_ALT_RIGHT_ON) != 0;
|
||||
|
||||
int keyMod = 0;
|
||||
|
|
@ -606,7 +607,8 @@ public final class TerminalView extends View {
|
|||
if (event.isAltPressed() || leftAltDown) keyMod |= KeyHandler.KEYMOD_ALT;
|
||||
if (shiftDown) keyMod |= KeyHandler.KEYMOD_SHIFT;
|
||||
if (event.isNumLockOn()) keyMod |= KeyHandler.KEYMOD_NUM_LOCK;
|
||||
if (!event.isFunctionPressed() && handleKeyCode(keyCode, keyMod)) {
|
||||
// https://github.com/termux/termux-app/issues/731
|
||||
if (!fnDown && handleKeyCode(keyCode, keyMod)) {
|
||||
if (TERMINAL_VIEW_KEY_LOGGING_ENABLED) mClient.logInfo(LOG_TAG, "handleKeyCode() took key event");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -622,6 +624,7 @@ public final class TerminalView extends View {
|
|||
int effectiveMetaState = event.getMetaState() & ~bitsToClear;
|
||||
|
||||
if (shiftDown) effectiveMetaState |= KeyEvent.META_SHIFT_ON | KeyEvent.META_SHIFT_LEFT_ON;
|
||||
if (fnDown) effectiveMetaState |= KeyEvent.META_FUNCTION_ON;
|
||||
|
||||
int result = event.getUnicodeChar(effectiveMetaState);
|
||||
if (TERMINAL_VIEW_KEY_LOGGING_ENABLED)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue