WebAPI/BrowserAPI/KeyboardEvent: Difference between revisions

Line 341: Line 341:
[[File:Mozbrowserkeyxxx translate.png|800px|frameless|center]]
[[File:Mozbrowserkeyxxx translate.png|800px|frameless|center]]


In this part, these four events need to `preventDefault()`. Because we have not implement customization yet, and we should let hardware key handling process just as the same as before.
This translation would make sure the original finite state machine in hardware_buttons.js and software_button_manager.js works as usual. All other outer module still listens to custom events generate in hardware_buttons.js (that is, home/sleep/home+sleep/holdhome/holdsleep/wake/volumeup/volumedown). In this part, these four events need to `preventDefault()`. Because we have not implement customization yet, and we should let hardware key handling process just as the same as before.


==== Part 2 - Key event handling customization ====
==== Part 2 - Key event handling customization ====
Line 350: Line 350:




Here are two possible way to do it
Here are two possible way to do it (TBD)
# Build time customization - generate json configuration file, read it at start-up time
# Build time customization - generate json configuration file at build time, and read it at start-up time
# Run time customization - settings value?
# Run time customization - settings value?
==== Part 3 - Remove all translated low-level input events ====
In this part, we need to refactor both hardware_buttons.js and software_button_manager.js to remove all low-level input event names.  In software_button_manager.js, we should dispatch events the same as new key event (such as mozbrowserbeforekeydown or keydown...etc)


=== Bugs ===
=== Bugs ===
Confirmed users
23

edits