Using "Command + F" to call a function

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JackBroughton
Posts: 9
Joined: Tue Oct 21, 2014 2:18 am

Using "Command + F" to call a function

Post by JackBroughton » Thu Mar 12, 2015 3:20 am

Hi all,

I created a search function that works now I want that function to be called if "Command + F" is pressed.

How do I do this?

Any help will be appreciated!

Jack

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Using "Command + F" to call a function

Post by dunbarx » Thu Mar 12, 2015 3:47 am

Jack

I normally would:

1- Make you jump through hoops.
2- Annoy half the helpers here.

The important thing is to know is that you want to invoke a function, but you need a message to do that. A message that is sent when you press the commandKey.

You might, knowing you need a message, and that the commandKey is involved, find "commandKeyDown" in the dictionary.

Try this:

Code: Select all

on commandKeyDown tKey
   if tKey = "F" then answer "It's an F!"
end commandKeyDown
So a little hoop. Where is the best place to put this handler?

Craig Newman

Post Reply