Clear keyboard message

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
newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Clear keyboard message

Post by newpie » Sat Feb 20, 2016 12:17 am

Hello, I have the following code. I use it to open another card on a different stack. I am trying to get rid of the ding sound that occurs when you do ALT+[letter]. I tried to stop pending messages, but it had no effect. Is it possible to cancel the ALT+[letter] action and yet still have it open my other card?

Code: Select all

on rawKeyDown theKeyNumber
   switch (theKeyNumber)
      case 111 -- o add
         if the altKey is down then
            go to card "Card 1" of stack "OtherStack"
            break
         end if
      case 113 -- q tube
         if the altKey is down then
            go to card "Card 2" of stack "OtherStack"
            break
         end if
   end switch
   pass rawKeyDown
end rawKeyDown

Thanks for any help.

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

Re: Clear keyboard message

Post by Klaus » Sat Feb 20, 2016 10:42 am

Hi newpie,

sorry, what "ding sound" are you talking about? Never heard of!
On what platform are you hearing this?
:shock:


Best

Klaus

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: Clear keyboard message

Post by newpie » Sat Feb 20, 2016 9:27 pm

No problem Klaus,

I am on Windows 7. I am not sure if you have a windows OS, but I believe it is an error sound if the window is already open. It makes the same sound if you try to close a window but lets say a pop up box is preventing the close, it will make the ding sound.

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

Re: Clear keyboard message

Post by Klaus » Sun Feb 21, 2016 10:18 am

Aha, sounds like this is a Windows specific issue, no problem on a Mac.
Sorry, no idea if and how you could workaround this.

Maybe just use the CMD (STRG) or CONTROL key as a modifier?
If these don't make any sound! :D

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Clear keyboard message

Post by [-hh] » Sun Feb 21, 2016 1:59 pm

Hi all,

newpie, you are repeatedly generating system shortcuts.

1. You cannot override (global) system shortcuts.
2. Try rawkeyUp. Then the repeat rate setting of your keyboard doesn't come in
(or use "no repeat" if the app is for your own only).


Hermann
shiftLock happens

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: Clear keyboard message

Post by newpie » Thu Feb 25, 2016 4:08 am

Thank you -hh and others. I did figure out what was going on. I forgot I had put shortcuts for the buttons as well. Thanks for all the help.

Post Reply