Now that you've learned how to parse a signature using a ScripTouch EasyScript device you may be wondering how to hide the ugly text box so that your users never have to see the keyboard string.
This tutorial will walk you through adding a signature event listener to your document that will capture keyboard events before anything gets to your web application and will notify you of the signature. We'll be using Google Chrome for this example but this should work with the most recent versions of most popular browsers.
Start by creating a new text document and name it "easyscript02.html" and place it in the same folder as scriptel-easyscript.js that was distributed with the API package. In the file put the following code/markup:
Now try this example by loading it in your browser. You should see a blank page. Try signing on your signature pad and hitting "Ok". A couple seconds later you should see your signature appear on the screen without hitting any buttons.
This works because in this example you've attached a signature listener to the document. This listener intercepts keyboard presses as they're generated and it looks for the pattern of a ScripTouch signature pad. If the signature is found it prevents the keys from being pressed and it captures the output.
After an entire signature is captured it's parsed and sent off to any interested parties. The registerSignatureCallback function let the EasyScript object know you were interested in being notified when a signature was captured. The body of the function in registerSignatureCallback is called any time a signature is captured and parsed. The sig argument is the signature that was captured.