aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_win.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-29 14:49:56 +0200
committerDavid Robillard <d@drobilla.net>2019-07-24 01:02:52 +0200
commit1deb98f57f7b597be941fd944a91f2daa1a1f10a (patch)
tree12420662e97aae6c71e6ded7709f23a5ce973b70 /pugl/pugl_win.c
parentfd7d496d4c5dcd9377ce945989ce05f464dc3afc (diff)
downloadpugl-1deb98f57f7b597be941fd944a91f2daa1a1f10a.tar.gz
pugl-1deb98f57f7b597be941fd944a91f2daa1a1f10a.tar.bz2
pugl-1deb98f57f7b597be941fd944a91f2daa1a1f10a.zip
Rename PuglEventKey::utf8 to "string" with char type
This matches Gtk and is generally less annoying to work with.
Diffstat (limited to 'pugl/pugl_win.c')
-rw-r--r--pugl/pugl_win.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c
index 9d5b124..c2ccff3 100644
--- a/pugl/pugl_win.c
+++ b/pugl/pugl_win.c
@@ -534,24 +534,24 @@ static void
wcharBufToEvent(wchar_t* buf, int n, PuglEvent* event)
{
if (n > 0) {
- char* charp = (char*)event->key.utf8;
+ char* charp = (char*)event->key.string;
if (!WideCharToMultiByte(CP_UTF8, 0, buf, n,
charp, 8, NULL, NULL)) {
/* error: could not convert to utf-8,
GetLastError has details */
- memset(event->key.utf8, 0, 8);
+ memset(event->key.string, 0, 8);
// replacement character
- event->key.utf8[0] = 0xEF;
- event->key.utf8[1] = 0xBF;
- event->key.utf8[2] = 0xBD;
+ event->key.string[0] = 0xEF;
+ event->key.string[1] = 0xBF;
+ event->key.string[2] = 0xBD;
}
event->key.character = utf16_to_code_point(buf, n);
} else {
// replacement character
- event->key.utf8[0] = 0xEF;
- event->key.utf8[1] = 0xBF;
- event->key.utf8[2] = 0xBD;
+ event->key.string[0] = 0xEF;
+ event->key.string[1] = 0xBF;
+ event->key.string[2] = 0xBD;
event->key.character = 0xFFFD;
}
}