Under Mir, physical keyboard’s Return key does not work within web pages

Bug #1433138 reported by Rick Spencer
42
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical Pocket Desktop
Fix Released
Critical
Michał Sawicz
Canonical System Image
Fix Released
Critical
Michał Sawicz
webbrowser-app
Invalid
Undecided
Unassigned
qtubuntu (Ubuntu)
Fix Released
Critical
Olivier Tilloy

Bug Description

1. Install whatever silo's are necessary to turn on convergence and BT keyboard support on a Nexus 7
2. Attach your BT keyboard, mine is the very popular Logitech Tablet Keyboard for iPad
3. Open the browser app
4. Using the keyboard, type "pastebin.ubuntu.com" into the address bar and hit return, noticing that return works
5. In content, type a-<return>-a-<return>, not that only "aa" is entered
6. Open the Edit app and type a-<return>-a-<return> and note that it displays as expected

Related branches

Revision history for this message
Will Cooke (willcooke) wrote :

I can confirm this happens.

I am able to work around it by hitting Ctrl-M to get a new line in a text area box (specifically paste.u.c).

Changed in webbrowser-app:
status: New → Confirmed
Revision history for this message
Will Cooke (willcooke) wrote :

Also, on a USB connected keyboard in a U8 session on an x86 machine - same thing. Ctrl-M works, the enter key doesn't.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Could you tell me which USB keyboard you're using? I'll probably need to get hold of one to investigate this

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Probably not a webbrowser-app bug

Changed in webbrowser-app:
status: Confirmed → Invalid
Changed in oxide:
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

Will: does the enter key work in the browser on the same machine in a standard desktop (unity7) session, by any chance?

Revision history for this message
Will Cooke (willcooke) wrote :

USB kbd was a generic one, no brand information. I will test under U7 and report back.

Revision history for this message
Will Cooke (willcooke) wrote :

Browser in U7 works as expected. Enter inserts a new line.

Olivier Tilloy (osomon)
tags: added: keyboard
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Same issue if running unity8/mir + webbrowser on the laptop. Enter key wouldn't work in textareas (in my case I wanted to leave a comment on Launchpad). Keyboard is the generic one in my laptop. Enter seems to work fine in other apps. Also confirm it works for the webbrowser when running it on X11. Maybe Mir sends a slightly different keycode? Enter vs Return or so. Chris, could you check what ends up in the browser and compare X11 and Mir.

Revision history for this message
Olivier Tilloy (osomon) wrote :

The difference between X and Mir seems to be the value of QKeyEvent::nativeVirtualKey(). Under X, the event for Return has a value of 65293, whereas under Mir it has a value of 0. Under both display servers the value of QKeyEvent::key() is identical, it is Qt::Key_Return.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Looking at the code in qtubuntu (https://bazaar.launchpad.net/~phablet-team/qtubuntu/trunk/view/head:/src/ubuntumirclient/input.cpp#L426), QKeyEvents are constructed without a native virtual key, so no wonder the value is always 0 under Mir.

It looks to me like in UbuntuInput::dispatchKeyEvent(), QKeyEvents should be constructed with a native virtual key, set to the value of xk_sym.

summary: - Bluetooth keyboard Return key does not work within web pages
+ Under Mir, physical keyboard’s Return key does not work within web pages
affects: oxide → qtubuntu
Olivier Tilloy (osomon)
Changed in qtubuntu:
assignee: nobody → Olivier Tilloy (osomon)
status: Confirmed → In Progress
importance: Undecided → High
Revision history for this message
Olivier Tilloy (osomon) wrote :

The attached qtubuntu-branch fixes the issue outlined above, however the Enter key still doesn’t input a line break in text areas.

On X, I’m seeing three events for each key press: RawKeyDown, Char, KeyUp (regardless of whether it’s a character or Enter).
On Mir, I’m seeing the same three events for character keys, but only two events for Enter: RawKeyDown, KeyUp.

So it looks like one event is not being sent.

Revision history for this message
Olivier Tilloy (osomon) wrote :

In qtubuntu, in src/ubuntumirclient/input.cpp, the text of the key event is obtained using the translateKeysym function, which always returns a null string for known symbols such as XKB_KEY_Return and XKB_KEY_KP_Enter (see https://bazaar.launchpad.net/~phablet-team/qtubuntu/trunk/view/head:/src/ubuntumirclient/input.cpp#L362). This doesn’t look right, under X11 the text for an Enter event is "\n" (ASCII 13).

Revision history for this message
Olivier Tilloy (osomon) wrote :

Correction: ASCII 13 is '\r'. Special casing XKB_KEY_Return and XKB_KEY_KP_Enter to set the corresponding text to "\r" does the trick, so it should be good enough to fix that bug, but I suspect there is a larger problem with non-latin1 characters in general that are not handled properly. I can’t really prove it though, because Mir currently hardcodes a en_US keyboard layout, so there’s currently no way to input non-latin1 characters.

Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: none → ww04-2016
importance: Undecided → High
Changed in canonical-pocket-desktop:
importance: Undecided → High
Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
Changed in canonical-pocket-desktop:
assignee: nobody → Michał Sawicz (saviq)
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: New → In Progress
Changed in canonical-pocket-desktop:
status: New → In Progress
Changed in canonical-devices-system-image:
importance: High → Critical
Changed in qtubuntu:
importance: High → Critical
Changed in canonical-pocket-desktop:
importance: High → Critical
Revision history for this message
Victor Tuson Palau (vtuson) wrote :

how can this bug has not progressed in 13days?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Well there has been progress. There is a fix available in a branch that was approved 9 days ago, Michał said he’d take care of landing it, so I trust it will land in time for OTA-9.5.

Revision history for this message
Michał Sawicz (saviq) wrote :

It's in a silo already.

tags: added: lt-blocker
Olivier Tilloy (osomon)
Changed in qtubuntu:
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-pocket-desktop:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
milestone: ww04-2016 → 9.1
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
kevin gunn (kgunn72)
Changed in canonical-pocket-desktop:
status: Fix Committed → Fix Released
Michał Sawicz (saviq)
affects: qtubuntu → qtubuntu (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.