When I press certain letters on the computer keyboard it triggers notes in the MidiKeyboardComponent (an excellent feature, thanks Jules!)
However, if I hold any of those computer keys down for more than a couple seconds I begin to get the “dong” sound that is normally generated when you hit a key that doesn’t have a shortcut. And it happens over and over in a machine-gun fashion. This doesn’t happen when I hold down shortcut keys assigned to other functionalities in my program, only the MidiKeyboardComponent’s. Even stranger, if I press another key to trigger a MidiKeyboard note, WHILE holding down the other “dong” generating key, the dongs go away.
Is this a bug, or is there an easy way to disable this that I’m missing?
Yeah, I do know about that, just never got around to looking into it. It’s probably just because the keyPressed method is returning false or something simple like that.
When you look at your code, always ask yourself “how well could this be gzipped?” In general, if gzip would achieve a high compression ratio, it’s a bad sign!
Before I used that very WET technique, I tried just returning true. But it messed with the keypresses that triggered the octave switch, so I had to get more specific. Your solution is much more graceful than mine though, thanks.