Open orenagiv opened 7 years ago
Hi Oren,
Unfortunately I was unable to get this to work properly with hardware devices (that's what I need it for too). This plugin is still in development; I will update the readme to reflect that. Glad to had some success with it at least. If you've got some time to look into this I would certainly appreciate a second set of eyes. Here're some links and information that I've collected recently which I hoped would help.
https://developer.android.com/training/keyboard-input/commands.html https://examples.javacodegeeks.com/android/core/ui/events/android-physical-keys-example/
@Override public boolean onKeyUp (int keyCode, KeyEvent event){ char c = (char) event.getUnicodeChar(); //Do something.... return super.onKeyUp(keyCode, event); }
The android documentation is not very clear on how to handle key presses. There was some documentation that suggested newer versions on android might have a different way of handling key presses, but again I'm not sure. I haven't even looked at iOS yet.
Hey,
Thanks!
I'm also investigating and will let you know if I find a solution.
For iOS I have a solution:
https://github.com/paragon-creations/cordova.externalkeyboard
It works great but I couldn't wrap it as a standalone Cordova plugin - it requires some manual changes to the IOS project outside the plugin.
I've posted this question on StackOverflow... http://stackoverflow.com/questions/41862667/cordova-plugin-for-passing-keycode-of-a-keyup-event-to-the-app
I posted something similar a while back and got no hits. http://stackoverflow.com/questions/39173850/cordova-plugin-keyboard-events-android
I installed an app that tracks all events of any kind being fired on the device, and confirmed that the key up and down events are indeed firing as expected. Doesn't help that much but at least the events are named as we thought and not something else.
Hey,
Here is what we are trying:
https://github.com/paragon-creations/cordova-plugin-keystrokes
In trying to consult with experienced people in this field. Hope to have some successful results soon.
If you have any ideas - please send! :)
Regards,
Oren.
a, pre, code, a:link, body { word-wrap: break-word !important; }
Best of luck to you. I don't currently have any fresh ideas but am hoping to have some time soon to revisit this. The best help I can offer right now is to take a look at the commit history of the repo. I tried a number of different solutions before ending on the current implementation.
Hey,
I've tried:
Then verified it works by using:
And got:
(which is good)
But when I then used an external keyboard (barcode in my case) - It didn't fire any of the callback functions.
Any ideas?