Livecode shortcuts not working.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Livecode shortcuts not working.

Post by CAsba » Mon Jan 29, 2024 8:47 pm

Hi all,
The ctrl + 9 works OK to select the 'browse' tool, but the Ctrl = 0, to select the edit tool, does not.
Also the ctrl + alt + tab shortcut, to toggle between the two, doesn't work. It occurs to me that maybe I have an incompatible setting somewhere; anyone any ideas how to resolve this ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Livecode shortcuts not working.

Post by dunbarx » Mon Jan 29, 2024 9:56 pm

CAsba.

I use a customized tool to change between the two. This involves trapping the rawKeyDown message in a plug-in stack handler. My point is that in making these gadgets, I often bypass (and render inoperative) the "normal" built-in keyboard shortcuts. Have you done anything similar?

Craig

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Livecode shortcuts not working.

Post by CAsba » Tue Jan 30, 2024 12:16 pm

Hi Craig,
Yes I have made keyboard shortcuts for buttons on the card, but I was careful not to use the Ctrl + 0 and Ctrl + 9. I just commented out all theshorcuts I made on the card and voila, Ctrl +9 and Ctrl + 0 now work.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Livecode shortcuts not working.

Post by dunbarx » Tue Jan 30, 2024 3:02 pm

CAsba.

OK, good news. But what did you comment out that freed the two shortcuts of interest? Can you list them for me? I am interested...

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Livecode shortcuts not working.

Post by jacque » Wed Jan 31, 2024 6:50 pm

Did you pass the key handlers if they didn't match the keystrokes you were interested in capturing? If not, that would explain why they failed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Livecode shortcuts not working.

Post by CAsba » Tue Feb 06, 2024 1:57 pm

Hi Craig,
I commented out..

Code: Select all

on commandkeydown tkey
switch tkey
casr "1"
send "mouseup"  to btn "help"
break
case "2"
send "mouseup"
 to btn "tryout"
 break
 end switch
 end commandkeydown
  
In fact there were many more 'cases' than I have shown here (because I am sending this from another computer and cannot copy and paste) including numbers up to 8 and nsome letters, B, K, L, F, G, H, I, K, M, N, O, Q, R, T, U, W, and Y, but all followed the same format.

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Livecode shortcuts not working.

Post by CAsba » Tue Feb 06, 2024 2:00 pm

Hi Jacque,
Sorry, I'm afraid I just didn't understand your question. I should explain that I really AM a complete beginner!

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Livecode shortcuts not working.

Post by Klaus » Tue Feb 06, 2024 3:25 pm

What she meant is this, see teh DEFAULT case:

Code: Select all

on commandkeydown tkey
   switch tkey
      case "1"
      send "mouseup"  to btn "help"
      break
   case "2"
      send "mouseup" to btn "tryout"
      break
      
   default
      ## pass all unhandled keys to LC or the operating system so they can handle it if neccessary:
      pass commandkeydown
      break
end switch
end commandkeydown

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Livecode shortcuts not working.

Post by CAsba » Tue Feb 06, 2024 4:20 pm

Hi Klaus, Many thanks for that - you wrote something I could understand ! Yes, now the keyboard shortcuts work fine, AND the Ctrl + 0 and Ctrl + 9 also work. Great stuff ! Thanks a lot !

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Livecode shortcuts not working.

Post by jacque » Tue Feb 06, 2024 6:09 pm

CAsba wrote:
Tue Feb 06, 2024 2:00 pm
Hi Jacque,
Sorry, I'm afraid I just didn't understand your question. I should explain that I really AM a complete beginner!
Klaus came to the rescue.🙂
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”