PDA

View Full Version : detect keyboard string



warteschlange
May 18th, 2005, 12:10 AM
I want to start a command when a keyboard sequence like 0124\n is typed, No ctrl or Alt key, just a real typed string with CR/LF at the end.
I understand, that this may cause side effects, typing the string accidentally .

I'm only able to start the command with one single key.

I did search the forum for keyboard / macro. Nothing found.

Thanks
Andres Obrero

birty
May 18th, 2005, 12:27 AM
this would have to be done with a lua script, set up a lua script to recieve all keyboard events and make it log each key press and when return or enter are pressed check the keys that have been pressed for the keys you want to detect

warteschlange
May 19th, 2005, 12:19 AM
hmpff,
it seems that LUA will need far more time, than i have.
Is there somebody how can make for me this LUA Script?
I don't think, that it will be to complex, at least for somebody who already did LUA code.

This is the scenario:
Imaging Children and and disabled people taking a CD-cover put it in front of a barcode reader.
The reader send a string, mostly emulating the (USB - HID) keyboard. There exist also barcode readers on the Com-Port.
The string constist mostly of numbers, but can also contain other character. Mostly ending with a <CR-LF>.
This string triggers the girder to start a mp3 player. There may also be extra barcode for 'stop' playing or to 'pause'.
The barcode patterns should be saved on a textfile, so i can modify them with XUL.

I make this project for a non-profit organisation in switzerland, helping disabled people,
but of course we can discuss about payment, as i really appreciate it.

Such code can also be usefull as string macro. You type date<tab> and girder writes the actual date string.

Here you can see a image of my idea (the code was written in javascript) outplacement (http://www.out-in.ch/outplacement.php) of ideas

Thanks
Andres Obrero
Switzerland

Promixis
May 19th, 2005, 03:10 AM
Actually, if you look at the build channel number example in the groups download area, you could adopt it with too much trouble.