How to find key code value for HW yellow left and right button in TC27 PDA

// Expert user has replied.
c chetan patel 4 days 10 hours ago
15 2 0

Hello

I am cordova developer.

i tryed to get key code value for Hardware yellow button left and right using "keydown" event but always return  key: "Unidentified" and keyCode: 0

"keydown" even


> Response

can you please give me suggestion for how to get key code value for both button in javascript side?

Thank you

 

Please Register or Login to post a reply

2 Replies

I Ian Hatton

The yellow buttons are defined as triggers so they can't be detected as keys in standard Javascript. However, if you use Zebra Enterprise Browser then you can detect triggers using the EB.KeyCapture.captureTrigger() method as detailed here : https://techdocs.zebra.com/enterprise-browser/5-0/tutorial/keycapture/

 

N Nicola De Zolt

Because the yellow keys will only work with a Zebra device, you could capture the onKeyUp/Down in the Android plugin, such as here in this sample project https://github.com/NDZL/ionic-cap-echo/blob/main/android/src/main/java/com/ndzl/cap/echo/EchoPluginPlugin.java 

When the key code is captured, pass it back to the common UI code as I did here  with notifyListeners  https://github.com/NDZL/ionic-cap-echo/blob/b00a7f102a9dd1874edc020a0097bacee6c7d808/android/src/main/java/com/ndzl/cap/echo/EchoPluginPlugin.java#L73 

Finally, in the js/ts code, receive the value in a locally defined listener such as this one

https://github.com/NDZL/ionic-cap-use-datawedge-echoplugin/blob/c421ff32dbb3acd6229137c474e27abeb9320ece/src/app/tab1/tab1.page.ts#L24

Please recall that the yellow buttons are mapped to trigger the barcode scanner, so if you just need to scan, refer to DATAWEDGE https://techdocs.zebra.com/datawedge/13-0/guide/about/, which relies on Intents to deliver data and be configured.

 

 

CONTACT
Can’t find what you’re looking for?