I've overridden an NSOpenGLView to handle keyboard events. The event detection is working fine, but every time I press a key I hear and annoying bump sound. How can I tell my view to chill out?
Here's what my keyUp: method looks like:
-(void) keyUp:(NSEvent *)theEvent
{
NSString *characters = [theEvent charactersIgnoringModifiers];
if ( [characters length] != 1 )
return;
unichar keyChar = [characters characterAtIndex:0];
if ( keyChar == NSLeftArrowFunctionKey )
{
//do something
return;
}
if ( keyChar == NSRightArrowFunctionKey )
{
//do something
return;
}
if ( keyChar == NSUpArrowFunctionKey )
{
//do something
return;
}
if ( keyChar == NSDownArrowFunctionKey )
{
//do something
return;
}
}