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

Android mobile Keyboard interpreted as "shift-enter" #693

Open
Ra0R opened this issue Sep 17, 2021 · 21 comments
Open

Android mobile Keyboard interpreted as "shift-enter" #693

Ra0R opened this issue Sep 17, 2021 · 21 comments

Comments

@Ra0R
Copy link

Ra0R commented Sep 17, 2021

Issue summary

Happens for me on firefox on android.

Expected behavior

Command is entered and executed.

Actual behavior

Command is entered, when pressing "Enter" on the android keyboard a newline character is made but the command is not executed.

After pressing "Enter" a second time, the command is executed (e.g. "help ", note the newline character after "help")

Any ideas? Might be specific to my implementation.

@jcubic
Copy link
Owner

jcubic commented Sep 17, 2021

I need to investigate, will test firefox on Android and let you know. Actually, I didn't test on FF/Android, maybe it works a little bit differently than mobile Chrome that I usually test.

@jcubic
Copy link
Owner

jcubic commented Sep 17, 2021

It seems this works fine. Here is my testing page: https://terminal.jcubic.pl/android.php
There is an issue with Firefox calculating the size of the terminal, the terminal is bigger than the width of the browser window. I need to investigate this.

@jcubic
Copy link
Owner

jcubic commented Sep 17, 2021

I think the page was zoomed somehow. Terminal works fine on Android in Firefox.

You need to check your settings and/or your code. Maybe you have enabled capslock.

@jcubic
Copy link
Owner

jcubic commented Sep 17, 2021

Another idea is that you're using some non-standard keyboard that behaves differently. It would be nice if you can create reproduction. Saying I have an issue without giving any clue what you exactly have is not very helpful. You need a little bit of work otherwise I will not be able to help you.

@Ra0R
Copy link
Author

Ra0R commented Sep 29, 2021

Hey there, sorry I didnt get any notifications.
I'm using Gboard which is the Google Keyboard.
The behaviour is the same in the mobile test as I have described.

@Ra0R
Copy link
Author

Ra0R commented Sep 29, 2021

Screenshot_2021-09-29-21-30-30-33_3aea4af51f236e4932235fdada7d1643

@Ra0R
Copy link
Author

Ra0R commented Sep 29, 2021

However it does not seem to be persistent.

@jcubic
Copy link
Owner

jcubic commented Sep 29, 2021

I personally use a swift keyboard, I didn't use a built-in keyboard for a while. I have different behavior on that keyboard, I have completion and I need to type enter two times, first to end completion and second to send enter. But I don't have any shift happening.

I have some debugging tools in this terminal like the keypress command but I think that I will need a keydown event for this.

Can you try like 10 commands, maybe there is a pattern like each odd is giving shift.

@Ra0R
Copy link
Author

Ra0R commented Oct 1, 2021

So I tried around alot, I feel like it has something to do with the autocomplete function. For instance you press "H", "Helper" is autocompleted and you delete the last 2 letters.

Maybe autocmplete triggers a keypress/keydown event?

@jcubic
Copy link
Owner

jcubic commented Oct 1, 2021

Yes, autocomplete triggers but I think it triggers input event (this is how it use to work when I first started to work on mobile).
On textarea solution, I've disabled autocomplete, but for the Android that I was using it was not working, later the browser added support.

Maybe I just need to disable autocomplete for mobile as well as desktop. But I'm not sure if the browser doesn't ignore this setting.

@Ra0R
Copy link
Author

Ra0R commented Oct 29, 2021

Hey there I was wondering if there is any progress regarding this?

Or if you can point me towards the necessary classes, I will take a stab at it.

@jcubic
Copy link
Owner

jcubic commented Oct 29, 2021

Sorry, I was busy, forget about this issue, and didn't have the chance to check if my hypothesis is correct. I need to check if content editable allows to turn off autocomplete and test. Will try to create a demo and upload it to https://terminal.jcubic.pl/android.php and you will able to check if this solve the issue.

@jcubic
Copy link
Owner

jcubic commented Oct 29, 2021

I've tried to disable spellcheck but it doesn't work. But fortunately, It works in CodeMirror 6, (I was using an older version as inspiration for a few techniques for handling input on desktops like copy-paste and select-all). Will check how it was solved in Codemirror and will try to recreate the solution.

@jcubic
Copy link
Owner

jcubic commented Oct 30, 2021

It should be fixed now, I'm not exactly sure how CM6 fixed the issue but I've figured out this on my own. You can test it on https://terminal.jcubic.pl/android.php (that uses devel branch code).

@jcubic
Copy link
Owner

jcubic commented Jan 29, 2022

I'm closing this because of inactivity the issue was fixed and released in version 2.30.0.
Please comment when the bug is still present, I will reopen it.

@jcubic jcubic closed this as completed Jan 29, 2022
@adamclement-exe
Copy link

underscore character on every android keyboard i've tried is interpreted as pressing enter.
tested on my site at http://adamsbashgame.pythonanywhere.com/ as well as https://terminal.jcubic.pl/android.php
try typing the command "cd Dimension_C-137" or "test_underscore" to replicate the issue

@jcubic jcubic reopened this Jan 2, 2023
@jcubic
Copy link
Owner

jcubic commented Jan 2, 2023

@adamclement-exe I cannot reproduce this on my Phone and BrowserStack, what kind of keyboard you're using?

@adamclement-exe
Copy link

adamclement-exe commented Jan 2, 2023

gboard, swiftkey and samsung keyboards on android - using chrome

@jcubic
Copy link
Owner

jcubic commented Jan 2, 2023

I use swiftkey and I don't see any issues, I will try to switch to gboard.
BTW: Your website is missing the mobile viewport meta tag.

@adamclement-exe
Copy link

adamclement-exe commented Jan 4, 2023

i've noticed that it's fine if the command starts with underscore, but not if the underscore is halfway through input.
e.g.
"_underscore test" - works as expected
"Dimension_C-137" - doesn't and it counts the underscore as "_"<enter>

this only seems to happen on android, only on actual (not virtualised) devices, and only with mid-input underscores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants