os independent keyboard input listener service (windows, linux and mac)
€30-250 EUR
Cerrado
Publicado hace casi 11 años
€30-250 EUR
Pagado a la entrega
We need an os independent keyboard input listener service (windows, linux and mac).
Basically we have a usb scanner connected to a computer that scans a bar code for a cash register system. When a certain type of bar codes (customer cards) is being scant,
we want to execute some command lines and open a browser with a special url.
Luckily USB-Scanners simulate USB-keyboards. A scan always end with a
"enter" like a newline \n (in windows).
So your task is to provide an OS independent C++ input listener that waits in the background for a matching regular expression and then executes a given command line.
Example on windows OS:
Scanner gives input like 12dc@sdsrX4\n that is a special code and
then the command line
[login to view URL] -para1 [login to view URL]"12dc@sdsrX4"
will be executed.
The program should be configurable via a config file. In this config file there should be a set of rules (regular expressions) and resulting actions (command lines)
Example config:
rule1 = [a-zA-Z0-9]{4}@[a-zA-Z0-9]{5,6}[@]{0,1}
com1 = [login to view URL] -para1 [login to view URL]"%s"
where %s is the matching code. So rule1 is basically 4 chars ranging
from a to z,A to Z or 0 to [login to view URL] the 5th char is an @ and then followed by
5 or 6 normal chars and an optional @ at the end. So in total, the code comprises 11 characters. A dot will never be in the code, what will help to exclude email addresses which are accidentally scanned. So 12dc@sdsrX4 or AAAA@BBBBB@ are valid codes.
Please ask if you have any questions.
Also see:
[login to view URL]
for a windows example for building a similar program
[login to view URL]
for the regular expressions