diff options
author | David Robillard <d@drobilla.net> | 2017-07-23 11:10:33 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-10-03 16:20:52 +0200 |
commit | 7a05b7c03c3819b2e8f4edcbcc40803a0d808111 (patch) | |
tree | bfb746780570066a73434ad91160d95911c368c1 | |
parent | 665dfdd7c5689838c6cef0406b2b4197383c24e5 (diff) |
Send zero instead of replacement char for invalid key strings
-rw-r--r-- | pugl/pugl_osx.m | 3 |
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 |