Page 1 of 1

Clear keyboard message

Posted: Sat Feb 20, 2016 12:17 am
by newpie
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.

Re: Clear keyboard message

Posted: Sat Feb 20, 2016 10:42 am
by Klaus
Hi newpie,

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


Best

Klaus

Re: Clear keyboard message

Posted: Sat Feb 20, 2016 9:27 pm
by newpie
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.

Re: Clear keyboard message

Posted: Sun Feb 21, 2016 10:18 am
by Klaus
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

Re: Clear keyboard message

Posted: Sun Feb 21, 2016 1:59 pm
by [-hh]
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

Re: Clear keyboard message

Posted: Thu Feb 25, 2016 4:08 am
by newpie
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.