From 596c5a70974f151b18e729c5fc7e1a732315d903 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Fri, 27 May 2016 18:15:58 +0200 Subject: [PATCH] Char callback got lost for some reason --- src/native/macosx/OSXWindow.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/native/macosx/OSXWindow.m b/src/native/macosx/OSXWindow.m index bfa6447..bab4a9f 100644 --- a/src/native/macosx/OSXWindow.m +++ b/src/native/macosx/OSXWindow.m @@ -70,6 +70,14 @@ key_callback(rust_data, [event keyCode], 1); } + if (char_callback) { + NSString* characters = [event characters]; + NSUInteger i, length = [characters length]; + + for (i = 0; i < length; i++) + char_callback(rust_data, [characters characterAtIndex:i]); + } + [super keyDown:event]; }