Page 1 of 1

Hotkey when other application is in focus?

Posted: Wed Jan 15, 2014 9:17 pm
by frankel
Hello,

Is there a strategy in Windows that will let my LC application detect a "hotkey" when the user is actively using another application and my LC application is running in the background?

Users will be in excel and I'd like to execute an action in my app when they hit a hotkey.

Strategies I've considered but not found solutions for:
- sending a vbscript message to my LC application
- using a 3rd party hotkey application and having it talk to my LC application somehow

Thank you,
-Frankel

Re: Hotkey when other application is in focus?

Posted: Sat Jan 25, 2014 7:20 pm
by Ledigimate
Hello Frankel,

You'll need to create your own LiveCode external that can install a low-level keyboard hook.
For more information, head over to the "Developers" section of the livecode website, and choose "Desktop Externals" on the left-hand side.
You may need to do some C++ or C# coding. You'll need to use the SetWindowsHookEx function in particular.

I hope this helps.

Regards,
- Ledigimate

-- EDIT: It may not have to be a low-level hook. A normal keyboard hook may suffice.

Re: Hotkey when other application is in focus?

Posted: Sun Jan 26, 2014 9:51 am
by richmond62
Gottit:

http://livecode.com/developers/guides/d ... externals/

as a Linux user I am slightly miffed that this guide seems only to refer to how to do things on Windows and Macintosh.
LC_gadfly.png

Re: Hotkey when other application is in focus?

Posted: Sun Jan 26, 2014 11:17 am
by Thierry
richmond62 wrote: as a Linux user I am slightly miffed that this guide seems only to refer to how to do things on Windows and Macintosh
Hi Richmond,

This works for linux externals too..
At least it has worked for me few years ago (eg: rev2perl / sunnyperl)

Regards,

Thierry

Re: Hotkey when other application is in focus?

Posted: Sun Jan 26, 2014 11:29 am
by richmond62
I wonder where the helpful pictures have gone?

image1 src="/wp-content/uploads/2013/10/desktop_externals_1.jpg" />

isn't all that useful.