Frequently Asked Questions

How to use RK25 UHF Gun trigger key to launch barcode reader?
Last Updated 2 years ago

Since RK25 UHF Gun has no API to launch barcode reader on RS25, there is an alternative
method can be integrated in an APP to trigger barcode reader.

1. In UHF Gun, the trigger will end out a key code. Please refer to the following sample code
to get Key Up and Key Down event.

2. Since the key event has been detected, programmer can use software trigger API to trigger
barcode reader on RK25.

Sample Code:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {

if(event.getAction()==KeyEvent.ACTION_DOWN)
{
textvvv.setText("KeyCode = " + String.valueOf(event.getKeyCode()) + " , \nMeta = " + String.valueOf(event.getMetaState()) + ", \nAction = " + event.getAction());
Log.i("TAG_KEY","KeyCode = " + event.getKeyCode() + ", Meta = " + event.getMetaState() + ", Action = " + event.getAction() + ", RepeatCount = " + event.getRepeatCount());

if(event.getKeyCode()==545)
Log.i("TAG_KEY","Pistol Key keycode");
}


return super.dispatchKeyEvent(event);
}

Please Wait!

Please wait... it will take a second!