Alive <[email protected]> writes: > Hi folks, > > Story: > we had caught hardware key events in shell.js and prevent it to be > sent to user app(mozbrowser iframe) but only send alternative > mozChromeEvent to system app only.[1] > > But we'd like the user app is able to catch the events! [2] > > This is an old issue from long time ago, > and yesterday I tried to make a quick workaround patch to broadcast > those events via system message (and tells systems app do not launch > the app acquires hardware button events), but @:fabrice thinks this is > a hack ;)
Indeed a hack ;) > So if we're going to use DOM3 KeyboardEvents [3], we have some problems needs > to resolve: > * Gonk is mapping volumeup key/volumedown key to pageup/pagedown now. > With this we couldn't tell user app to use |evt.key = > KeyboardEvent.DOM_VK_PAGE_UP| instead of DOM_VK_VOLUME_UP. > @:mwu, any idea about this? This issue shall fall under gonk if I'm > not wrong. We could change the mapping. With DOM3 KeyboardEvents those key should have evt.key == 'VolumeDown' or 'VolumeUp'. > * What if the user app do |preventDefault()| ? > Shall we allow this usage for volumeup/volumedown, even for home and sleep > button? > Could we 'prevent' the preventDefault() call in this case? > @:smaug, could you please offer some opinion? I think we should broaden the definition of the DOM event flow. The event flows like 'B2G Chrome'-->'Window Manager (System app)'-->'Currently focused app' And we could define the default action of those events. System app could catch the event even if the app tries to preventDefault it (if it's cancelable) Kanru > * Gecko has a whitelist of events could pass the mozbrowser > iframe. [3] But now if there's a non-mozbrowser iframe falls under a > mozbrowser iframe, the events couldn't pass to the parent frame. This > needs some fix. > > Any help is appreciated, thanks!! > -- > [1] See https://bugzilla.mozilla.org/show_bug.cgi?id=762362. > [2] See https://bugzilla.mozilla.org/show_bug.cgi?id=820706. > [3] See https://bugzilla.mozilla.org/show_bug.cgi?id=842927. > [4] See https://bugzilla.mozilla.org/show_bug.cgi?id=757486. > -- > Alive C. Kuo, Front-end Engineer, FirefoxOS, MoCo. Taiwan, Taipei office. > [email protected] _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
