Closed
Bug 1097814
Opened 10 years ago
Closed 10 years ago
Software buttons are broken in mulet and simulator
Categories
(Firefox OS Graveyard :: Simulator, defect)
Firefox OS Graveyard
Simulator
Tracking
(Not tracked)
RESOLVED
FIXED
2.2 S1 (5dec)
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(2 files, 3 obsolete files)
1.45 KB,
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
5.23 KB,
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
Bug 1014418 most likely regressed these features. It looks like we need to send other kinds of events to gaia now (don't know yet what?). We used to send mozChromeEvent to the system app.
Comment 1•10 years ago
|
||
Hi Alexandre, Did you mean software home buttons or software buttons you simulate in mulet and simulator? If you mean the latter, this is because after bug 1014418 landed, system app no longer listens to mozChromeEvent. Bug 989198 made KeyboardEvents dispatched across browser elements. System app now listens to KeyboardEvent and BeforeAfterKeyboardEvent introduced in bug 989198. This page describe the whole scenario: https://wiki.mozilla.org/WebAPI/BrowserAPI/KeyboardEvent#Dispatch_KeyboardEvent_across_BrowserElements BeforeAfterKeyboardEvent is currently enabled in b2g only, with the pref 'dom.beforeAfterKeyboardEvent.enabled' set to true.
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Tzu-Lin Huang [:dwi2][:tzhuang] from comment #1) > Did you mean software home buttons or software buttons you simulate in mulet > and simulator? Yes, the ones in mulet, simulator and fx nightly mode.
Assignee | ||
Comment 3•10 years ago
|
||
It's not really clear how we can implement software buttons now. Before all these patches, pressing the HOME or END key of your keyboard was like pressing your home button and power button of your device. Now it no longer works. We used to send mozChromeEvent. I tried dispatching fake KeyboardEvent and/or BeforeAfterKeyboardEvent, but nothing appear to work. What precise kind of event should I dispatch on the system app to make it work?? Here is what I tried: let systemAppContentWindow; let KeyEvent = systemAppContentWindow.KeyEvent; var e = new systemAppContentWindow.KeyboardEvent("keydown", {keyCode: KeyEvent.DOM_VK_HOME}); // Replacing KeyboardEvent with BeforeAfterKeyboardEvent doesn't change anything // Dispatching keydown, keyup or keypress doesn't work systemAppContentWindow.dispatchEvent(e); Or should I directly fake some mozbrowserbeforekeydown events?!
Flags: needinfo?(tzhuang)
Comment 4•10 years ago
|
||
Hi Alexandre, What you tried is almost right, except that you need to change {keyCode: KeyEvent.DOM_VK_HOME} to {key: 'Home'}. This is because we try to follow DOM level 3 definition. Here is the key mapping: Home key: 'Home' Power key: 'Power' Volume up key: 'VolumeUp' Volume down key: 'VolumeDown' I tried your code snippet with key definition above. And it works on mulet. let systemAppContentWindow; let KeyEvent = systemAppContentWindow.KeyEvent; var e = new systemAppContentWindow.KeyboardEvent("keydown", {key: "Home"}); systemAppContentWindow.dispatchEvent(e); Also I press the HOME key on my physical keyboard when I use mulet, it also works.
Flags: needinfo?(tzhuang)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → poirot.alex
Summary: Sofware buttons are broken in mulet and simulator → Software buttons are broken in mulet and simulator
Assignee | ||
Comment 5•10 years ago
|
||
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=a9be118ddbad
Attachment #8524143 -
Flags: review?(fabrice)
Comment 6•10 years ago
|
||
Comment on attachment 8524143 [details] [diff] [review] b2g desktop patch Review of attachment 8524143 [details] [diff] [review]: ----------------------------------------------------------------- ::: b2g/chrome/content/desktop.js @@ +30,5 @@ > // so that click events are delayed and it is better to > // listen for touch events. > homeButton.addEventListener('touchstart', function() { > + let window = shell.contentBrowser.contentWindow; > + let e = new window.KeyboardEvent("keydown", {key: "Home"}); As much as I prefer double quotes for strings, it looks like this file foolishly mixes quote style but uses single quotes in the functions touched by this patch.
Attachment #8524143 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 7•10 years ago
|
||
I had to expose the system app frame from SystemAppProxy in order to dispatch the KeyboardEvents... (instead of mozChromeEvent)
Assignee | ||
Updated•10 years ago
|
Attachment #8524396 -
Flags: review?(paul)
Attachment #8524396 -
Flags: review?(21)
Assignee | ||
Comment 8•10 years ago
|
||
Fixed quotes.
Attachment #8524143 -
Attachment is obsolete: true
Attachment #8524507 -
Flags: review+
Assignee | ||
Comment 9•10 years ago
|
||
Really fix them...
Attachment #8524507 -
Attachment is obsolete: true
Attachment #8524567 -
Flags: review+
Assignee | ||
Comment 10•10 years ago
|
||
Checkin needed for attachment 8524567 [details] [diff] [review].
Keywords: checkin-needed,
leave-open
Updated•10 years ago
|
Attachment #8524396 -
Flags: review?(paul) → review+
Assignee | ||
Comment 11•10 years ago
|
||
No longer expose system app frame. Exposes a helper on SystemAppProxy instead.
Attachment #8524396 -
Attachment is obsolete: true
Attachment #8524396 -
Flags: review?(21)
Attachment #8526178 -
Flags: review?(21)
Assignee | ||
Comment 12•10 years ago
|
||
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=f9e9b36e7aa6
Assignee | ||
Comment 14•10 years ago
|
||
Comment on attachment 8526178 [details] [diff] [review] responsive design patch for mulet Review of attachment 8526178 [details] [diff] [review]: ----------------------------------------------------------------- Carry over review from paul and got offline r+ from vivien.
Attachment #8526178 -
Flags: review?(21) → review+
Assignee | ||
Comment 15•10 years ago
|
||
Checking needed for the second patch.
Keywords: leave-open → checkin-needed
Comment 16•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/dcdd75b0017f
Keywords: checkin-needed
Comment 17•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/dcdd75b0017f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S1 (5dec)
You need to log in
before you can comment on or make changes to this bug.
Description
•