Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>We have this feature in our application with even 1 more integrated step to start with. I will describe it fully, as it might be useful to you.</p> <p>We have a modal dialog that allows the user to enter the Serial Id for a device by either keying it in with the keyboard or just scanning the barcode tag.</p> <p>Step 1. We have a menu item with a Hot Key (Shortcut Ctrl+Alt+N for instance). We have configured the scanner so that it sends this preamble whenever it scans a barcode. (Manual equivalent of keying in the shortcut). That opens the modal dialog.</p> <p>Step 2. The Focus is in a Edit box to get the Serial ID either from the user and the keyboard or from the scanner reading the barcode.</p> <p>Step 3. There are an [OK] and a [Cancel] buttons. The OK button has <code>Default:=True</code> and <code>ModalResult:=mrOK</code>. The Cancel button has <code>Cancel:=True</code> and <code>ModalResult:=mrCancel</code>. The scanner is set to postfix the scanned string with Enter which has the same effect as the user hitting the [Enter] key or clicking the OK button: it closes the modal dialog with mrOK in the ModalResult so we can read the Edit.text to get the SerialID.</p> <p>Step 3bis. The user presses [Esc] or click on Cancel or closes the dialog with the title bar close button: it closes the dialog with anything but <code>mrOK</code> and we discard whatever is in the Edit...</p> <p>Works very well in our case with any scanner working as an HID emulation (keyboard) and where we can configure the preamble. (sending Enter at the end was by default in all the scanners we tried).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload