WebAPI/InputMethod API with hardware keyboard: Difference between revisions

Line 29: Line 29:
# External API
# External API
## Register/unregister a listener to handle the key events in keyboard app
## Register/unregister a listener to handle the key events in keyboard app
### '''mozInputMethod.inputcontext.addEventListener('keydown', function handler() {});'''
### Add "keydown" and "keyup" events to '''mozInputMethod.inputcontext''' object
### '''mozInputMethod.inputcontext.removeEventListener('keydown', handler);'''
### Register: '''mozInputMethod.inputcontext.addEventListener('keydown', function handler() {});'''
### These events are non-bubbles and cancellable
### Unregister: '''mozInputMethod.inputcontext.removeEventListener('keydown', handler);'''
### The events "keydown" and "keyup" are identical to the one that the input field expects to receive
### Events are non-bubbles and cancellable.
### The event objects of "keydown" and "keyup" are identical to the one that the input field expects to receive
### No "keypress" since there's no use case
### No "keypress" since there's no use case


Confirmed users
133

edits