aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-07-23 11:10:33 +0200
committerDavid Robillard <d@drobilla.net>2017-10-03 16:20:52 +0200
commit7a05b7c03c3819b2e8f4edcbcc40803a0d808111 (patch)
treebfb746780570066a73434ad91160d95911c368c1 /pugl/pugl_osx.m
parent665dfdd7c5689838c6cef0406b2b4197383c24e5 (diff)
downloadpugl-7a05b7c03c3819b2e8f4edcbcc40803a0d808111.tar.gz
pugl-7a05b7c03c3819b2e8f4edcbcc40803a0d808111.tar.bz2
pugl-7a05b7c03c3819b2e8f4edcbcc40803a0d808111.zip
Send zero instead of replacement char for invalid key strings
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index c087a1c..d911441 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -437,6 +437,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev)
const NSPoint rloc = [NSEvent mouseLocation];
const NSString* chars = [event characters];
const char* str = [chars UTF8String];
+ const uint32_t code = puglDecodeUTF8((const uint8_t*)str);
PuglEventKey ev = {
PUGL_KEY_PRESS,
puglview,
@@ -448,7 +449,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev)
[[NSScreen mainScreen] frame].size.height - rloc.y,
getModifiers(puglview, event),
[event keyCode],
- puglDecodeUTF8((const uint8_t*)str),
+ (code != 0xFFFD) ? code : 0,
keySymToSpecial(puglview, event),
{ 0, 0, 0, 0, 0, 0, 0, 0 },
false