summaryrefslogtreecommitdiff
path: root/common/rawaccel-io.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-31 19:41:21 -0400
committera1xd <[email protected]>2020-08-31 19:41:21 -0400
commit9010cc593af419dd824dba0ade6a2022aea6143f (patch)
tree90a82ee14dbb112621657efbd2523ed35f59d154 /common/rawaccel-io.hpp
parentclean up wrapper, minimize heap alloc (diff)
downloadrawaccel-9010cc593af419dd824dba0ade6a2022aea6143f.tar.xz
rawaccel-9010cc593af419dd824dba0ade6a2022aea6143f.zip
add independent xy accel to driver
other changes: modifier_args type name is now settings, which is now the type passed in driver ioctl remove most settings/args verification from driver, plan to let gui handle most of it add another accel arg, rate, which is used to set the 'accel' parameter of types which call exp (nat/sig), might want to cap it add (update) serializable DriverSettings (ModifierArgs) class to gui and static methods for interop remove properties from ManagedAccel, its now just a black box for accessing modifier methods add exception handling in wrapper_io to throw proper managed types change SettingsManager::Startup to make a new settings file if an error occurs during deserialization change structure of accel types; how offset and weight are applied now depend on additivity of types remove tagged_union and add a handrolled variant/visit impl AccelGui::UpdateActiveValueLabels currently broken for caps and a few other args remove gui default layout and initial natural accel setup cli not updated
Diffstat (limited to 'common/rawaccel-io.hpp')
-rw-r--r--common/rawaccel-io.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp
index 582ea68..74e2d1e 100644
--- a/common/rawaccel-io.hpp
+++ b/common/rawaccel-io.hpp
@@ -5,7 +5,8 @@
#define NOMINMAX
#include <Windows.h>
-#include "rawaccel.hpp"
+#include "rawaccel-settings.h"
+#include "rawaccel-error.hpp"
#define RA_READ CTL_CODE(0x8888, 0x888, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define RA_WRITE CTL_CODE(0x8888, 0x889, METHOD_BUFFERED, FILE_ANY_ACCESS)
@@ -15,7 +16,7 @@
namespace rawaccel {
- mouse_modifier read() {
+ settings read() {
HANDLE ra_handle = INVALID_HANDLE_VALUE;
ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
@@ -24,7 +25,7 @@ namespace rawaccel {
throw install_error();
}
- mouse_modifier mod;
+ settings args;
DWORD dummy;
BOOL success = DeviceIoControl(
@@ -32,8 +33,8 @@ namespace rawaccel {
RA_READ,
NULL, // input buffer
0, // input buffer size
- &mod, // output buffer
- sizeof(mouse_modifier), // output buffer size
+ &args, // output buffer
+ sizeof(settings), // output buffer size
&dummy, // bytes returned
NULL // overlapped structure
);
@@ -44,11 +45,11 @@ namespace rawaccel {
throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed");
}
- return mod;
+ return args;
}
- void write(const mouse_modifier& mod) {
+ void write(const settings& args) {
HANDLE ra_handle = INVALID_HANDLE_VALUE;
ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
@@ -62,8 +63,8 @@ namespace rawaccel {
BOOL success = DeviceIoControl(
ra_handle,
RA_WRITE,
- const_cast<mouse_modifier*>(&mod), // input buffer
- sizeof(mouse_modifier), // input buffer size
+ const_cast<settings*>(&args), // input buffer
+ sizeof(settings), // input buffer size
NULL, // output buffer
0, // output buffer size
&dummy, // bytes returned