Frequently Asked Question
由於 RK25 UHF Gun 沒有在 RS25 上啟動條碼閱讀器的 API,因此有一個替代方案。
方法可以集成在APP中以觸發條碼閱讀器。
1. 在 UHF Gun 中,觸發器將結束一個key code。 請參考以下示例代碼
獲取 Key Up 和 Key Down 項目.
2. 由於檢測到按鍵項目,程式設計可以使用軟體觸發API來觸發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);
}Delete FAQ