Closed FrancescaBarbazeni closed 3 years ago
Hi, do you mean the physical trigger key or do you have a soft button on your UI that invokes DataWedgeIntents.ACTION_SOFTSCANTRIGGER? For the physical trigger, you might be able to use something like https://github.com/kevinejohn/react-native-keyevent to detect it. If the trigger is not detected then you may need to remap it using something like the technique described at http://www.darryncampbell.co.uk/2017/07/07/controlling-datawedge-via-key-presses/.
Thank you Darry,
but I'd like to do that in your module, not in the react component. Something like:
@Override
public void onKeyDown(int keyCode, KeyEvent event) {
if( keyCode === KeyEvent.KEYCODE_BUTTON_L1) {
SCAN_START = Calendar.getInstance().getTimeInMillis();
}
}
But obviously it doesn't work.
Thank you so much
I'm not sure why it doesn't work, maybe take a look at that other plugin I referenced as they are doing something in onKeyDown. Feel free to modify my module, it is released under MIT so there should be no licensing concerns. Edit: Just realised I had not labelled it as MIT - I will do that now...
Hello Darry,
I was wondering how to modify your module in order to obtain the time in which the scan button is pressed. This because I need to know how much time has passed between scanning start and scanning result (barcode data). Could I override some kind of Class to retrieve starting time?
Thank you, Francesca