implementing text input on osx
This commit is contained in:
@@ -265,6 +265,8 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
auto keyCode = [theEvent keyCode];
|
||||
auto chars = [theEvent characters];
|
||||
App::I.key_down(convert_key(keyCode));
|
||||
if (const char* cstr = [chars cStringUsingEncoding:NSASCIIStringEncoding])
|
||||
App::I.key_char(cstr[0]);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)keyUp:(NSEvent *)theEvent
|
||||
|
||||
Reference in New Issue
Block a user