Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right arrow on Samsung keyboard not working #1906

Closed
stefano-xy opened this issue Jan 24, 2021 · 9 comments
Closed

Right arrow on Samsung keyboard not working #1906

stefano-xy opened this issue Jan 24, 2021 · 9 comments

Comments

@stefano-xy
Copy link

Problem description

Right arrow present on Samsung virtual keyboards does not work.

Steps to reproduce

Obtain a Samsung device with Samsung keyboard matching the version below. Older virtual keyboards don't have arrow keys. The one I'm talking about has also backspace and delete as keys, both working.

Open the terminal, default settings and packages. Type some text. Move left and right using the two arrows provided by the keyboard next to the world icon, below right shift. Move also using CTRL+arrow to jump word by word (e.g. in bash or nano). Right arrow produce no effect, left arrow does, basically you can only move left.

VolumeUp+D works. It seems to be independent of the language set.

Expected behavior

Right arrow works as well as left arrow, including combinations such as CTRL+right arrow.

Additional information

  • Termux application version: 0.101 from Google Play
  • Android OS version: 10
  • Device model: Samsung S5e
  • Samsung keyboard: 5.1.15.1
@RalfWerner
Copy link

RalfWerner commented Jan 24, 2021

grafik
I've a corresponding keyboard (sorry in German here) with the settings in termux/termux.properties works right!

@stefano-xy
Copy link
Author

stefano-xy commented Jan 24, 2021

I don't have any special setting, just the default.

Interesting to see that termux seems to be aware of this keyboard layout, as it removes left and right arrows from the shortcut bar, next to ESC tab CTRL and so on on top of the keyboard. I have for example up and down arrows, because the virtual keyboard doesn't have them, but I don't have left and right arrows since they're provided by the keyboard already.

I think it should work out of the box with default settings, especially if left arrow works.

TERM=xterm-256color

@RalfWerner
Copy link

RalfWerner commented Jan 24, 2021

With Samsung KB is enforce-char-based-input=true required (known bug/workaround)! With you, too?

If Yes you can close this issue! I like to use the extra-keys (shot above) because they also work without OS-KB (floating), which is often not needed!

@stefano-xy
Copy link
Author

stefano-xy commented Jan 24, 2021

Yes, this setting solves it, thanks.

However note that I don't experience bugs like the one enforce-char-based-input is supposed to solve. I didn't need to press space to see my text, meaning the virtual keyboard didn't buffer the keys.

I think the bugs are unrelated and this setting resolves the bug I reported by chance. I would try to investigate and solve the issue anyway. It is always good if users are not forced to configure a setting to avoid a bug.

I can help you debugging, is there a tool to see which scan codes or characters are received by the terminal? How would you explain that left arrow works but right not?

@stefano-xy
Copy link
Author

stefano-xy commented Jan 24, 2021

For example, if I type dd with no parameters, I enter in a mode where special characters are printed. Pressing the keys, I see the following:

Arrow up - ^[[A
Arrow down - ^[[B
Arrow right - ^[[C only when setting is enabled, nothing otherwise
Areow left - ^[[D

No clue why right arrow doesn't work.

@RalfWerner
Copy link

RalfWerner commented Jan 25, 2021

The workaround (and reasons for it) is described at the end of this wiki page. The problem has to fix in Android and not Linux and can only be solved if the developer has a Samsung device - most likely here - have fun with the pull request :)
Samsung has been able to add a lot (e.g. in this article) versus Android. I can understand the small group of developers if they avoid everything device-specific.

Yes, this setting solves it, thanks.

So close this issue

@stefano-xy
Copy link
Author

Give me please some days to debug it, I'll close if I can't find it, send a PR otherwise.

@RalfWerner
Copy link

If you're an Android expert and your device supports PiP (pop-up view, bubbles), you can check out my investigations and you may find solutions for my bugs!
A closed issue is also retained and a PR get a new number. Since I am not a developer I cannot close here.

@stefano-xy
Copy link
Author

So, I debugged it directly on the device. I think this is yet another limitation of the Samsung keyboard. It does not trigger any onKeyPreIme in general, and in particular it does not trigger anything at all, neither onKeyPreIme nor onKeyDown when pressing the right arrow. Left arrow triggers onKeyDown.

Closing, I'd say it's not a bug or anything on the android part of Termux. It's just simply the Samsung keyboard that doesn't pass the right arrow with default settings (InputType.TYPE_NULL) to the android app. There's nothing we can do.

As said previously, solution is to set enforce-char-based-input to true.

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants