- Topics - 3
- Replies - 66
- Total Posts - 69
How can i detect action of pressing scan button on the device?
Twain sepcyfication allows for it?
You probably have to contact the vendor of the scanner that you want to support to find out how, or if, the device supports this via TWAIN. I’m guessing most vendors don’t support it.
The only thing I see in the specification that seems to fit is CAP_DEVICEEVENT/TWDE_DEVICEREADY or possibly a vendor-specific event using TWDE_CUSTOMEVENTS.
On Windows, the STI (STill Image) interface supports a way to launch an application when the scanner button is pressed. Here’s how to see if your device supports this OS-specific feature:
1) Go into Control Panel->Scanners and Cameras.
2) Right-click on the scanner and select Properties.
3) If the Properties window has an “Events” tab, the device does support STI events. Check that one of the events is a button press.
Here’s how to register your application as an STI event handler:
And detect when an STI event has caused your app to be launched: