I redefined NSOpenGLView to handle keyboard events. Event detection works fine, but every time I press a key, I hear and annoy the sound of terrain. How can I say my eyes are cooling?
Here my keyUp: method looks like this:
-(void) keyUp:(NSEvent *)theEvent
{
NSString *characters = [theEvent charactersIgnoringModifiers];
if ( [characters length] != 1 )
return;
unichar keyChar = [characters characterAtIndex:0];
if ( keyChar == NSLeftArrowFunctionKey )
{
return;
}
if ( keyChar == NSRightArrowFunctionKey )
{
return;
}
if ( keyChar == NSUpArrowFunctionKey )
{
return;
}
if ( keyChar == NSDownArrowFunctionKey )
{
return;
}
}
source
share