Fix iOS/macOS keycode handling regression for textoverlay example, update and use keycodes.hpp defines for iOS/macOS

This commit is contained in:
Stephen Saunders 2022-05-13 21:57:30 -04:00
parent 8080b7a91b
commit a1e19ea5de
5 changed files with 43 additions and 49 deletions

View file

@ -91,13 +91,13 @@ MVKExample* _mvkExample;
// SRS - Handle keyboard events
-(void) keyDown:(NSEvent*) theEvent {
NSString *text = [theEvent charactersIgnoringModifiers];
unichar keychar = (text.length > 0) ? [text characterAtIndex: 0] : 0;
unichar keychar = (text.length > 0) ? [text.lowercaseString characterAtIndex: 0] : 0;
_mvkExample->keyDown(keychar);
}
-(void) keyUp:(NSEvent*) theEvent {
NSString *text = [theEvent charactersIgnoringModifiers];
unichar keychar = (text.length > 0) ? [text characterAtIndex: 0] : 0;
unichar keychar = (text.length > 0) ? [text.lowercaseString characterAtIndex: 0] : 0;
_mvkExample->keyUp(keychar);
}