Page 1 of 1

How to listen to keyboard events

Posted: Tue Oct 16, 2012 9:27 am
by hylton
Hello,

I would like to create a simple application that performs the task of replacing text as the user types.

Example: The user types .ty and the program replaces it with Thank you.

The program would need to run in the notification area all the time and would need to listen for specific keyboard strokes. If there is a match between what the user is typing and the list of phrases that have been stored in the program, the text would be replaced.

The user would also be able to choose whichever key is used as the trigger. The above example show the period followed by letters as the trigger.

Is this possible with LiveCode?

If yes, could someone please point me in the right direction as to how to listen for keystrokes, and how to send the replacement text to the current active window.

Thank you.

Kind regards
Hylton

Re: How to listen to keyboard events

Posted: Tue Oct 16, 2012 10:30 am
by Klaus
Hi Hylton,

if you mean to "control" typing OUTSIDE of your Livecode app, this is not possible right out of the box!
That would require an external.


Best

Klaus

Re: How to listen to keyboard events

Posted: Tue Oct 16, 2012 10:40 am
by hylton
Hi Klaus

Yes, the user can be in Word, Excel, Firefox, or any other program that allows text input.

The LiveCode application would simply listen to what the keyboard is doing, and it there is a match, replace the text in the active Window.
Klaus wrote:That would require an external.
What do you mean, and where would I look for that?

Kind regards
Hylton

Re: How to listen to keyboard events

Posted: Tue Oct 16, 2012 10:56 am
by Klaus
Hi Hylton,
hyltonclarkeBUSH1Ex wrote:
Klaus wrote:That would require an external.
What do you mean, and where would I look for that?
Everything that is not supported natively by Livcode can be programmed in C etc. .
into an external file, check the "Externals" folder in the Livecode application folder.
All the "revXXX.dll"s are "externals".

I do not know if such an external exists nor where you could possibly look for this, sorry.


Best

Klaus