File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515#include < cwchar>
1616#include < memory>
1717#include < string>
18+ #include < unordered_map>
19+ #include < vector>
1820
1921namespace Utility {
2022
Original file line number Diff line number Diff line change 2626#include < algorithm>
2727#include < array>
2828#include < atomic>
29+ #include < codecvt>
2930#include < cstddef>
3031#include < cstdio>
3132#include < cstdlib>
@@ -1124,7 +1125,10 @@ int main(int argc, char *argv[]) {
11241125 // Syphon off the key-press if it's control+shift+V (paste).
11251126 if (event.key .keysym .sym == SDLK_v && (SDL_GetModState ()&KMOD_CTRL) && (SDL_GetModState ()&KMOD_SHIFT)) {
11261127 if (keyboard_machine) {
1127- keyboard_machine->type_string (SDL_GetClipboardText ());
1128+ char *const utf8 = SDL_GetClipboardText ();
1129+ std::wstring_convert<std::codecvt_utf8<wchar_t >> converter;
1130+ keyboard_machine->type_string (converter.from_bytes (utf8));
1131+ SDL_free (utf8);
11281132 break ;
11291133 }
11301134 }
You can’t perform that action at this time.
0 commit comments