I did a little research on this and I found a question. I implemented the code used there, but nothing happened. Here is the exact code I'm using:
.h file
.m file
#import "Test.h" @implementation Test - (void)keyDown:(NSEvent*)event { NSLog(@"A key has been pressed"); switch( [event keyCode] ) { case 126: // up arrow case 125: // down arrow case 124: // right arrow case 123: // left arrow NSLog(@"Arrow key pressed!"); break; default: NSLog(@"Key pressed: %@", event); break; } } @end
What's wrong? Is there something I need to add to the interface?
EDIT: Something actually happened. I sat at my computer. Nothing more.
source share