New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 629907 link

Starred by 19 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

In an Anrdroid app running through ARC, keyboard events have the wrong characters for international layouts.

Reported by workspac...@gmail.com, Jul 20 2016

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS armv7l 8530.13.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.15 Safari/537.36
Platform: 8530.13.0 (Official Build) dev-channel veyron_minnie

Steps to reproduce the problem:
1. Install an Android app with this code in an Activity on a Chromebook:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    Log.d(event.getUnicodeChar());
    return true;
}

2. Change your Chromebook's keyboard layout to something non-English (e.g. German).
3. Press a key which should give a different unicode character from the English layout. (e.g. the 'y' key which should type the letter 'z')

What is the expected behavior?
event.getUnicodeChar() returns 122 ('z'), or the appropriate unicode code point for the character that should be typed.

What went wrong?
event.getUnicodeChar() returns 121 ('y'), or whatever the key would be in an English layout.

WebStore page: 

Did this work before? N/A 

Chrome version: 53.0.2785.15  Channel: dev
OS Version: 8530.13.0
Flash Version: Shockwave Flash 22.0 r0

The behavior is also wrong if you run the app through ARC Welder, but slightly differently. Specifically, pressing the 'ΓΌ' key (where the { is on an English keyboard) gives ';'. 

Interestingly, in Android standard controls, like EditTexts, the input is correct.
 
Thank you for your report!

We are currently working on keyboard layouts for KeyEvents. 

Most text input is going through the IME code path, which takes care of keyboard layouts, IME display, etc. However for raw KeyEvents we still need to do more work in terms of keyboard layouts. 

There are two steps to this. The first step is mapping the key codes as described in https://developer.android.com/reference/android/view/KeyEvent.html

But those key codes only know US keyboard keys, there are no umlaut or other special character codes, so this will account for things like switched y and z keys, etc). 

Special characters need another layout map called KeyCharacterMap, which maps the key codes into unicode characters.

The key code mapping is currently targeted at version M54 and that will match the behavior you are seeing with ARC Welder. 
The KeyCharacterMap to provide full unicode support is going to be a more complex issue and will probably not get in before M55. 

Cc: elijahtaylor@chromium.org adlr@chromium.org
Labels: M-54
Owner: denniskempin@chromium.org
Status: Assigned (was: Unconfirmed)
https://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html
In our App we are using this interface to read enter key from keyboard or barcode scanners.
mEditText.setOnEditorActionListener(new OnEditorActionListener()
{
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event){
    if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER){
        // some app logic
        return true;
    }
    return false;
    }
});

It's never get this callback.
Tested on Windows 10 and MAC OS X with latest ARC and chrome canary.

#3: That seems to be a separate issue of the one being discussed here, but to clarify: Are you using this ARC: https://developer.chrome.com/apps/getstarted_arc
or are you using the native Android with the Google Play Store running on Chrome OS? 
Yeah I am using this: https://developer.chrome.com/apps/getstarted_arc
on MAC OS and windows 10, have not tried on ChromeBook or Chrome OS.
omprakashsrv@gmail.com: That is a separate issue on a separate technology. I have filed a separate bug for this: https://bugs.chromium.org/p/chromium/issues/detail?id=637293

Owner: denniskempin@google.com
Labels: -M-54 M-55
Owner: denniskempin@chromium.org
Labels: ARCWelder
Same issue. Acer Chromebook 14, Chrome 61
Termux on a Chromebook with German keyboard is receiving keys from US layout. Sounds like this issue? (63.0.3239.86)
Cc: fouchal@google.com
Owner: yhanada@chromium.org
There is an internal bug tracking the issue at b/27877642

It looks like yhanada recently made some changes to fix the issue. I will re-assign to him. 
The first step mentioned in comment 1 should be fixed already.

Cc: soushi@chromium.org
Cc: yhanada@chromium.org
Owner: blakeo@chromium.org
Cc: yusukes@chromium.org
Components: -Platform>Apps Platform>Apps>ARC
Labels: -M-55 M-71

Sign in to add a comment