mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-02 23:21:06 +01:00
Translate \n to \r when receiving text from an IME
Fixes issue with fzf and return using the stock cyanogenmod keyboard reported by @mklein994 on gitter.
This commit is contained in:
parent
74040dd37f
commit
7d9d6fb797
1 changed files with 8 additions and 0 deletions
|
|
@ -298,6 +298,14 @@ public final class TerminalView extends View {
|
|||
|
||||
boolean ctrlHeld = false;
|
||||
if (codePoint <= 31 && codePoint != 27) {
|
||||
if (codePoint == '\n') {
|
||||
// The AOSP keyboard and descendants seems to send \n as text when the enter key is pressed,
|
||||
// instead of a key event like most other keyboard apps. A terminal expects \r for the enter
|
||||
// key (although when icrnl is enabled this doesn't make a difference - run 'stty -icrnl' to
|
||||
// check the behaviour).
|
||||
codePoint = '\r';
|
||||
}
|
||||
|
||||
// E.g. penti keyboard for ctrl input.
|
||||
ctrlHeld = true;
|
||||
switch (codePoint) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue