优化了键盘操作
This commit is contained in:
@@ -22,6 +22,7 @@ public class ScanGunKeyEventHelper {
|
||||
|
||||
// private String mDeviceName = "TMC HIDKeyBoard";
|
||||
private String mDeviceName = "Linux 3.4.35 with ak-hsudc Composite Gadget (ACM + HID)";
|
||||
private String mDeviceName1 = "USBKey Chip USBKey Module";
|
||||
|
||||
public ScanGunKeyEventHelper(Context context, OnScanSuccessListener onScanSuccessListener) {
|
||||
|
||||
@@ -156,9 +157,10 @@ public class ScanGunKeyEventHelper {
|
||||
*/
|
||||
public boolean isScanGunEvent(KeyEvent event) {
|
||||
if (event == null || event.getDevice() == null) return false;
|
||||
L.e("event===" + event.getDevice().getName() +
|
||||
String deviceName = event.getDevice().getName();
|
||||
L.e("event===" + deviceName +
|
||||
"===Char===" + event.getCharacters() +
|
||||
"===Action===" + event.getAction());
|
||||
return event.getDevice().getName().equals(mDeviceName);
|
||||
return deviceName.equals(mDeviceName) || deviceName.equals(mDeviceName1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user