onkeyup event in Safari on IOS7 from a bluetooth keyboard -
i have following setup:
- bluetooth scanner
- ipad
- webpage textfield scan input
usage:
- user focus textfield , scan barcode bluetooth scanner
- scanner adds enter (13) @ end of scan
problem:
on safari in ios7 there seems change on how keyboard events handled on bluetooth devices. code ...
window.onkeyup = function (e) { console.log(e.keyboardevent) }
... should return information key pressed. instead ...
keycode: 0 keyidentifier: "unidentified"
... no matter key press.
same result booth form bluetooth scanner , bluetooth keyboard.
thanks / e
seems "onkeypress" works expected though.
since problem bumbed in in sencha touch project , sencha touch doesn't have keypress event on textfields i'm posting code solved problem.
{ xtype:'searchfield', name:'search', placeholder:'search', listeners: { painted: { fn: function () { var me = this; me.element.dom.onkeypress = function (e) { if (e.keycode === 13) { me.fireevent('searchkeypress', me, e); } }; } } } }
Comments
Post a Comment