Hotkey when other application is in focus?

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
frankel
Posts: 3
Joined: Tue Dec 06, 2011 11:32 pm

Hotkey when other application is in focus?

Post 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
Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Re: Hotkey when other application is in focus?

Post 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.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Hotkey when other application is in focus?

Post 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
Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Hotkey when other application is in focus?

Post 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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Hotkey when other application is in focus?

Post 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.
Post Reply