Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off keyboard sounds in Cocoa application?

I have a problem with my OpenGL Cocoa application - every time a keyUp / KeyDown event is fired, a system sound is being played... How can I disable this logic for my application?

I have a bad feeling that for some strange reason my application may treat a key press as an error and play system alert sound... Please help!

like image 420
Ryan Avatar asked Dec 28 '22 11:12

Ryan


1 Answers

add to your NSView/NSWindow subclass

- (void)keyDown:(NSEvent *)theEvent {

and make exception on up and down keys, but for other [super keyDown:theEvent];

i think it's may sense

like image 121
Volodymyr B. Avatar answered Jan 20 '23 06:01

Volodymyr B.