Page 1 of 1

Livecode shortcuts not working.

Posted: Mon Jan 29, 2024 8:47 pm
by CAsba
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 ?

Re: Livecode shortcuts not working.

Posted: Mon Jan 29, 2024 9:56 pm
by dunbarx
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

Re: Livecode shortcuts not working.

Posted: Tue Jan 30, 2024 12:16 pm
by CAsba
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.

Re: Livecode shortcuts not working.

Posted: Tue Jan 30, 2024 3:02 pm
by dunbarx
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

Re: Livecode shortcuts not working.

Posted: Wed Jan 31, 2024 6:50 pm
by jacque
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.

Re: Livecode shortcuts not working.

Posted: Tue Feb 06, 2024 1:57 pm
by CAsba
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.

Re: Livecode shortcuts not working.

Posted: Tue Feb 06, 2024 2:00 pm
by CAsba
Hi Jacque,
Sorry, I'm afraid I just didn't understand your question. I should explain that I really AM a complete beginner!

Re: Livecode shortcuts not working.

Posted: Tue Feb 06, 2024 3:25 pm
by Klaus
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

Re: Livecode shortcuts not working.

Posted: Tue Feb 06, 2024 4:20 pm
by CAsba
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 !

Re: Livecode shortcuts not working.

Posted: Tue Feb 06, 2024 6:09 pm
by jacque
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.🙂