Fix F1 on/off toggle for ImGui overlay (all platforms), clean up keycode handling (mostly macOS/iOS)
This commit is contained in:
parent
5c2aaaf693
commit
1b3fe76cdb
7 changed files with 106 additions and 70 deletions
|
|
@ -97,7 +97,16 @@ MVKExample* _mvkExample;
|
|||
-(void) keyDown:(NSEvent*) theEvent {
|
||||
NSString *text = [theEvent charactersIgnoringModifiers];
|
||||
unichar keychar = (text.length > 0) ? [text.lowercaseString characterAtIndex: 0] : 0;
|
||||
_mvkExample->keyDown(keychar);
|
||||
switch (keychar)
|
||||
{
|
||||
case KEY_DELETE: // support keyboards with no escape key
|
||||
case KEY_ESCAPE:
|
||||
[NSApp terminate:nil];
|
||||
break;
|
||||
default:
|
||||
_mvkExample->keyDown(keychar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void) keyUp:(NSEvent*) theEvent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue