mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-19 14:23:55 +00:00
update type string fixed #155
This commit is contained in:
parent
cea1b340d7
commit
4e24e40d7e
@ -249,17 +249,20 @@ void unicodeType(const unsigned value){
|
|||||||
toggleUnicode(ch, true);
|
toggleUnicode(ch, true);
|
||||||
toggleUnicode(ch, false);
|
toggleUnicode(ch, false);
|
||||||
#elif defined(IS_WINDOWS)
|
#elif defined(IS_WINDOWS)
|
||||||
INPUT ip;
|
INPUT input[2];
|
||||||
|
memset(input, 0, sizeof(input));
|
||||||
|
|
||||||
// Set up a generic keyboard event.
|
input[0].type = INPUT_KEYBOARD;
|
||||||
ip.type = INPUT_KEYBOARD;
|
input[0].ki.wVk = 0;
|
||||||
ip.ki.wVk = 0; // Virtual-key code
|
input[0].ki.wScan = value;
|
||||||
ip.ki.wScan = value; // Hardware scan code for key
|
input[0].ki.dwFlags = 0x4; // KEYEVENTF_UNICODE;
|
||||||
ip.ki.time = 0; // System will provide its own time stamp.
|
|
||||||
ip.ki.dwExtraInfo = 0; // No extra info. Use the GetMessageExtraInfo function to obtain this information if needed.
|
|
||||||
ip.ki.dwFlags = KEYEVENTF_UNICODE; // KEYEVENTF_KEYUP for key release.
|
|
||||||
|
|
||||||
SendInput(1, &ip, sizeof(INPUT));
|
input[1].type = INPUT_KEYBOARD;
|
||||||
|
input[1].ki.wVk = 0;
|
||||||
|
input[1].ki.wScan = value;
|
||||||
|
input[1].ki.dwFlags = KEYEVENTF_KEYUP | 0x4; // KEYEVENTF_UNICODE;
|
||||||
|
|
||||||
|
SendInput(2, input, sizeof(INPUT));
|
||||||
#elif defined(USE_X11)
|
#elif defined(USE_X11)
|
||||||
toggleUniKey(value, true);
|
toggleUniKey(value, true);
|
||||||
toggleUniKey(value, false);
|
toggleUniKey(value, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user