File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11#include " OSOutput.h"
22
3- #include < codecvt>
43#include < string>
54
5+ #ifdef _WIN32
6+ #include < codecvt>
7+
68#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
79#include < windows.h>
810#include < stringapiset.h>
911#include < WinUser.h>
1012#undef WIN32_LEAN_AND_MEAN
13+ #endif
1114
1215OSOutput::OSOutput (){}
1316
1417OSOutput::~OSOutput (){}
1518
1619void OSOutput::deleteCharacter ()
1720{
21+ #ifdef _WIN32
1822 INPUT fakekey[2 ];
1923 fakekey[0 ].type = fakekey[1 ].type = INPUT_KEYBOARD;
2024 fakekey[0 ].ki .wVk = fakekey[1 ].ki .wVk = VK_BACK;
2125 fakekey[0 ].ki .time = fakekey[1 ].ki .time = 0 ;
2226 fakekey[1 ].ki .dwFlags = KEYEVENTF_KEYUP;
2327
2428 SendInput (2 , fakekey, sizeof (INPUT));
29+ #endif
2530}
2631
2732void OSOutput::outputCharacter (const std::string &sText )
2833{
34+ #ifdef _WIN32
2935 INPUT fakekey[2 ];
3036 if (sText [0 ] == ' \r ' && sText [1 ] == ' \n ' ) {
3137 // Newline, so we want to fake an enter
@@ -51,4 +57,5 @@ void OSOutput::outputCharacter(const std::string &sText)
5157
5258 delete[] wstr;
5359 }
60+ #endif
5461}
Original file line number Diff line number Diff line change 11#pragma once
2- #include < xstring >
2+ #include < string >
33
44
55class OSOutput
You can’t perform that action at this time.
0 commit comments