I have the following setup:
- iPad with Safari browser running a webb-application.
- Bluetooth barcode-scanner connected/paired with the iPad.
My web-application listens to keypress events globally which gives me the possibility to trigger scan functions without having the user to focus a textfield in the webb-application.
The above works fine when running the application on a desktop with an USB-scanner.
My problem is that the application doesn’t trigger keydown(press/up) events until a textfield is focused on the iPad when the bluetooth-scanner is connected.
Is it possible to achieve?
A related question from a while ago:
- Various barcode reader free SDK in iOS
- With Zxing retiring for iOS, which barcode-scanner to switch to?
- Suitable api to get product details from scanned barcode iphone app?
- Xcode AVCapturesession scan Barcode in specific frame (rectOfInterest is not working)
- Default keyboard is not coming when Barcode Scanner Device is Connected by Bluetooth in IOS
- Swift: Unable to detect linear type Barcodes
I believe that with mobile Safari (and most other iOS mobile browsers), keypresses are only detectable by the web app when a form input is infocus. Your device (without an external keyboard) can’t take keypress input without a form input being selected simply because the keyboard would not be up.
- Suppressing Implicit Returns in Swift
- Issues with touch scroll on iOS when focusing inputs
- NSLocale and country name
- Use Xcode Auto Layout for different image sizes on iPhone
- Requests to /.well-known/apple-app-site-association
- Search Bar in UITableView doesn't display text in Cell label
- How to animate UITableView header view
- Change a UIView Frame
- With what should I replace the deprecated sizeWithFont: method?
- How to animate application icon in iOS?
- How to Toast message in Swift?
- Why are my ASIHTTPRequest files showing ARC errors?
- Comparing NSDates without time component
- When to use a colon with a @selector
- Horizontal scroll using Swift