acceleratorKey for spacebar

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

acceleratorKey for spacebar

Post by Ultravibe » Sat Apr 18, 2015 12:09 pm

Hello!
I need to use Spacebar key for some operations (like start & stop).
in card's script i have construction like this:

Code: Select all

set acceleratorKey of btn "TimerButton" to ...
which spelling i should use to set Spacebar as accelerator Key?

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: acceleratorKey for spacebar

Post by Klaus » Sat Apr 18, 2015 1:06 pm

Hi Ultravibe,

I would try SPACE, but remember that you also need to set -> the acceleratorModifiers
to make the acceleratorkey work.


Best

Klaus

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: acceleratorKey for spacebar

Post by Ultravibe » Sat Apr 18, 2015 5:39 pm

I've tried SPACE but it doesn't work... what am i gonna do?

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: acceleratorKey for spacebar

Post by Klaus » Sat Apr 18, 2015 6:18 pm

Hi Ultravibe,

I never messed around with this "accelerator" stuff, too Windows like for me old time Mac-user :D

Try something like this in the card script, this is what I do usually:

Code: Select all

on keydown tKey
  if tKey = SPACE then
    send "mouseup" to btn "you know which one..."
    ## or do whatever you need to do here...
  else
   pass keydown
  end if
end keydown
You get the picture...


Best

Klaus

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: acceleratorKey for spacebar

Post by Ultravibe » Sat Apr 18, 2015 9:41 pm

Thank you, Klaus!
it works!!!!!!

Post Reply