Cannot open on-screen keyboard programatically

Bug #1296462 reported by Robert Schroll
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu HTML5 UI SDK
Fix Released
Undecided
Unassigned

Bug Description

There is apparently no way to trigger the OSK programatically through javascript. In some circumstances, it would be nice to get keypresses entered without a text input.

Revision history for this message
Robert Schroll (rschroll) wrote :

Adnane Belmadiaf suggested you might be able to achieve this by setting the keyboard focus to an input element. I have been unable to get that to work. The attached file has a text input with autofocus. In the HTML5 container, the text input does not get focus automatically. In the browser, the input does get focus, but the OSK is not triggered. The same behavior has been seen setting the focus programatically, rather than with the autofocus attribute.

This is seen on an emulator running r226.

Revision history for this message
Adnane Belmadiaf (daker) wrote :
Changed in ubuntu-html5-theme:
status: New → Triaged
Revision history for this message
Robert Schroll (rschroll) wrote :

Maybe I'm reading it wrong, but it looks like that code is reactive, unsetting focus when the keyboard goes away, not active in showing or hiding the keyboard.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

There is an upstream bug w/ qtwebkit about a js focus() not triggering the OSK:

https://bugs.launchpad.net/ubuntu/+source/ubuntu-keyboard/+bug/1220264

Atm, there is no way around as long as we have qtwebkit as the backend and we unfortunately have to work around it for now :(

The KeyboardRectangle in the webbrowser-app is passive indeed, and does not trigger anything, it is there to allow the autopilot tests to work better when the OSK is around (to have an idea about the amount of real estate that it occupies).

Changed in ubuntu-html5-theme:
assignee: nobody → rosa maria (rprosamaria383)
dobey (dobey)
Changed in ubuntu-html5-theme:
assignee: rosa maria (rprosamaria383) → nobody
Revision history for this message
Robert Schroll (rschroll) wrote :

In case anyone else is trying to work around this issue, here's the kludge I came up with to trigger and dismiss the OSK at will: https://github.com/rschroll/crosswords/commit/e714295baff5232b9bc6bcd7fcb621f4e09a8ca5. It's ugly and hacky, and I don't understand parts of it, but it seems to work on the emulator.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

Marked as fix since as we switched to Oxide, a call to focus() works.

Changed in ubuntu-html5-theme:
status: Triaged → Fix Released
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.