-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Special character input using right alt does not work correctly in Chrome on Android #1183
Comments
I have managed to gather more information through debugging. Please note that I haven't worked with CodeMirror before, so take this with a grain of salt. I used the Chrome remote debugger to gather this information. The fundamental issue is that CodeMirror sees the combination let scopeObj = map[scope], baseName, shiftName
if (scopeObj) {
if (runFor(scopeObj[prefix + modifiers(name, event, !isChar)])) return true
if (isChar && (event.altKey || event.metaKey || event.ctrlKey) &&
// Ctrl-Alt may be used for AltGr on Windows
!(browser.windows && event.ctrlKey && event.altKey) &&
(baseName = base[event.keyCode]) && baseName != name) {
// Suspect line below vvvvvvvvvvvvvvvvv
if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) return true
// Suspect line above ^^^^^^^^^^^^^^^^^
else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name && shiftName != baseName &&
runFor(scopeObj[prefix + modifiers(shiftName, event, false)])) return true
} else if (isChar && event.shiftKey) {
if (runFor(scopeObj[prefix + modifiers(name, event, true)])) return true
}
if (runFor(scopeObj._any)) return true
}
return fallthrough At that point, As a test, I cleared the As I'm not familiar with CodeMirror, I cannot offer any insight on what would be the correct way to resolve this. Speaking as a user, I would expect the keybinds to only work on an exact match with the binding. If I wanted to press I hope this clears up my bug report a bit. Please reach out if you need any additional information. |
Does Android set ctrlKey as well as altKey for AltGr key events? Some platforms don't set altKey for it (which makes sense, since it doesn't behave like Alt), but I'm not sure how Android works. I found a comment suggesting that it works like that but it'd be great if you could confirm. |
It seems there is no straightforward way to distinguish between Alt and AltGr on this platform then. This is problematic, because for example people using a Cyrillic keyboard expect Ctrl-z bindings to fire when they press Ctrl-ю, despite |
I don't have any special leverage with the Chrome team, but this inconsistency between platforms seems something you could report on https://bugs.chromium.org/ |
Describe the issue
When using a physical keyboard on Android, special character input using right alt (Sometimes called AltGr) does not work correctly in Chrome. It works correctly in Firefox.
Steps to reproduce:
RightAlt
+<letter>
. The following steps assume the US International Layout provided by Android (“English (US), International style” in the settings).RightAlt
+a
. The characterá
appears.RightAlt
+o
. The characteró
appears.RightAlt
+u
. No character appears in the text area! In Firefox and all other text inputs,ú
appears.Browser and platform
Chrome 114 on Android 12; Using physical keyboard layout "English (US), International style"
Reproduction link
https://codemirror.net/try/
The text was updated successfully, but these errors were encountered: