bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
113 stars 53 forks source link

Laserscanner Event #24

Closed nosTa1337 closed 3 years ago

nosTa1337 commented 6 years ago

Hi,

can anyone give me a hint how to work with a laserscanner?

I tried working with adb getevent and received the following things:

`add device 5: /dev/input/event0 name: "keyremap_virtual" events: KEY (0001): KEY_F12 KEY_HOME KEY_VOLUMEUP KEY_SCALE KEY_MENU KEY_WAKEUP KEY_PROG1 KEY_BACK KEY_UNKNOWN input props:

` and this is appears when I show a live listener with adb `[ 119373.240199] /dev/input/event0: EV_KEY KEY_PROG1 DOWN [ 119373.240276] /dev/input/event0: EV_SYN SYN_REPORT 00000000 [ 119374.770156] /dev/input/event0: EV_KEY KEY_PROG1 UP [ 119374.770280] /dev/input/event0: EV_SYN SYN_REPORT 00000000` How can I implement this in the eventlistener now? I tried listen to "keyremap_virtual" but nothing happens. The goal is to be able to trigger the laserscanner button anytime and receive the input to work with. Thanks for any advice.
bsorrentino commented 6 years ago

Take a look to issue #17

nosTa1337 commented 6 years ago

I may forgot to mention I am using Ionic 2 and the documentation says I just need to listen to the specific event:

https://ionicframework.com/docs/native/broadcaster/

// Listen to events from Native this.broadcaster.addEventListener('eventName').subscribe((event) => console.log(event));

I think if I do it that way I just need to know the correct event name. But I didn't manage to find it out yet.

bsorrentino commented 6 years ago

The only events that you could handle using plugin are the ones fired through LocalBroadcaster. This means that if laserscan events are fired in different way you have to bridge them. To have an idea how to do this take a look at #17

CjoyHome commented 6 years ago

Are you successful?

CjoyHome commented 6 years ago

I am using Ionic 2, But I this.broadcaster.addEventListener('android.intent.action.PACKAGE_ADDED').subscribe((event) => It is unsuccessful

bsorrentino commented 6 years ago

relate to #34

bsorrentino commented 3 years ago

closed for inactivity