diff options
| author | a1xd <[email protected]> | 2020-07-31 17:56:46 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-31 17:56:46 -0400 |
| commit | 1fcbb0fa51dbc35958d211026e4d40384a049049 (patch) | |
| tree | efb65bf3f305f376ea75f4f687b08bf8998c020f /console/console.cpp | |
| parent | Merge pull request #6 from a1xd/st-refactor (diff) | |
| parent | Show no settings for off, remove unused class for PR (diff) | |
| download | rawaccel-1fcbb0fa51dbc35958d211026e4d40384a049049.tar.xz rawaccel-1fcbb0fa51dbc35958d211026e4d40384a049049.zip | |
Merge pull request #7 from JacobPalecki/GUI
Add GUI
Diffstat (limited to 'console/console.cpp')
| -rw-r--r-- | console/console.cpp | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/console/console.cpp b/console/console.cpp index 490051c..549cb68 100644 --- a/console/console.cpp +++ b/console/console.cpp @@ -4,39 +4,7 @@ #include <Windows.h> #include <rawaccel-userspace.hpp> - -#define RA_WRITE CTL_CODE(0x8888, 0x888, METHOD_BUFFERED, FILE_ANY_ACCESS) - -namespace ra = rawaccel; - -void write(ra::mouse_modifier vars) { - HANDLE ra_handle = INVALID_HANDLE_VALUE; - - ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0); - - if (ra_handle == INVALID_HANDLE_VALUE) { - throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed"); - } - - DWORD dummy; - - BOOL success = DeviceIoControl( - ra_handle, - RA_WRITE, - &vars, - sizeof(ra::mouse_modifier), - NULL, // output buffer - 0, // output buffer size - &dummy, // bytes returned - NULL // overlapped structure - ); - - CloseHandle(ra_handle); - - if (!success) { - throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed"); - } -} +#include "console_write.hpp" int main(int argc, char** argv) { try { |