forked from termux/termux-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request termux#2237 from agnostic-apollo/extra-keys-conver…
…sion-to-agnosticism Extra keys conversion to agnosticism and disabling hardware keyboard shortcuts and terminal margin customization support
- Loading branch information
Showing
25 changed files
with
1,742 additions
and
772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/termux/app/terminal/io/TermuxTerminalExtraKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.termux.app.terminal.io; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.view.Gravity; | ||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.drawerlayout.widget.DrawerLayout; | ||
|
||
import com.termux.app.terminal.TermuxTerminalSessionClient; | ||
import com.termux.app.terminal.TermuxTerminalViewClient; | ||
import com.termux.shared.terminal.io.TerminalExtraKeys; | ||
import com.termux.view.TerminalView; | ||
|
||
public class TermuxTerminalExtraKeys extends TerminalExtraKeys { | ||
|
||
|
||
TermuxTerminalViewClient mTermuxTerminalViewClient; | ||
TermuxTerminalSessionClient mTermuxTerminalSessionClient; | ||
|
||
public TermuxTerminalExtraKeys(@NonNull TerminalView terminalView, | ||
TermuxTerminalViewClient termuxTerminalViewClient, | ||
TermuxTerminalSessionClient termuxTerminalSessionClient) { | ||
super(terminalView); | ||
mTermuxTerminalViewClient = termuxTerminalViewClient; | ||
mTermuxTerminalSessionClient = termuxTerminalSessionClient; | ||
} | ||
|
||
@SuppressLint("RtlHardcoded") | ||
@Override | ||
public void onTerminalExtraKeyButtonClick(View view, String key, boolean ctrlDown, boolean altDown, boolean shiftDown, boolean fnDown) { | ||
if ("KEYBOARD".equals(key)) { | ||
if(mTermuxTerminalViewClient != null) | ||
mTermuxTerminalViewClient.onToggleSoftKeyboardRequest(); | ||
} else if ("DRAWER".equals(key)) { | ||
DrawerLayout drawerLayout = mTermuxTerminalViewClient.getActivity().getDrawer(); | ||
if (drawerLayout.isDrawerOpen(Gravity.LEFT)) | ||
drawerLayout.closeDrawer(Gravity.LEFT); | ||
else | ||
drawerLayout.openDrawer(Gravity.LEFT); | ||
} else if ("PASTE".equals(key)) { | ||
if(mTermuxTerminalSessionClient != null) | ||
mTermuxTerminalSessionClient.onPasteTextFromClipboard(null); | ||
} else { | ||
super.onTerminalExtraKeyButtonClick(view, key, ctrlDown, altDown, shiftDown, fnDown); | ||
} | ||
} | ||
|
||
} |
92 changes: 0 additions & 92 deletions
92
app/src/main/java/com/termux/app/terminal/io/extrakeys/ExtraKeyButton.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.