From 733e0b23c8be3aaf078e873f6e9776a5ab792ce9 Mon Sep 17 00:00:00 2001 From: Alexis Nootens Date: Sat, 13 Feb 2016 12:19:45 +0100 Subject: [PATCH] cocoa: fix charcode retrieving for accented characters The handler was retrieving an invalid charcode for accented characters, thus ignoring them. --- osdep/macosx_events.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index 51aaf2aca4..6090a1937e 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -451,7 +451,8 @@ void cocoa_set_input_context(struct input_ctx *input_context) else chars = [event charactersIgnoringModifiers]; - int key = convert_key([event keyCode], *[chars UTF8String]); + struct bstr t = bstr0([chars UTF8String]); + int key = convert_key([event keyCode], bstr_decode_utf8(t, &t)); if (key > -1) [self handleMPKey:key withMask:[self keyModifierMask:event]];