User:Timdream/InputMethod API with hardware keyboard: Difference between revisions

Jump to navigation Jump to search
Line 10: Line 10:


'''Why not use <code>evt.perventDefault()</code>?''' The default action of an event is evaluated as soon as all event listeners are executed. The keyboard app might not be able to decide whether or not to suppress the usual key events at that point (if the decision is based on, say, an IndexedDB async query). So we opt to <code>block()</code> and <code>unblock(handled)</code>.
'''Why not use <code>evt.perventDefault()</code>?''' The default action of an event is evaluated as soon as all event listeners are executed. The keyboard app might not be able to decide whether or not to suppress the usual key events at that point (if the decision is based on, say, an IndexedDB async query). So we opt to <code>block()</code> and <code>unblock(handled)</code>.
* kanru
** Q: What about <code>interface HardwareKeyboardEvent : KeyboardEvent</code> so you don't have to copy the attributes?
** Q: What should unblock(false) do? Send the queued events to content? Could it queue more than one key events?


=== API addition ===
=== API addition ===
Confirmed users
346

edits

Navigation menu