diff options
| author | a1xd <[email protected]> | 2021-09-06 23:24:51 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-09-23 22:33:13 -0400 |
| commit | a8d48325d5e6fe0466502b865c82317b6f7410a2 (patch) | |
| tree | a1d42734cda76cdf2a0b0c8134ef25f4729e99b3 /wrapper | |
| parent | increase lut points capacity to 257 (diff) | |
| download | rawaccel-a8d48325d5e6fe0466502b865c82317b6f7410a2.tar.xz rawaccel-a8d48325d5e6fe0466502b865c82317b6f7410a2.zip | |
get grapher building
Diffstat (limited to 'wrapper')
| -rw-r--r-- | wrapper/input.cpp | 7 | ||||
| -rw-r--r-- | wrapper/wrapper.cpp | 21 |
2 files changed, 22 insertions, 6 deletions
diff --git a/wrapper/input.cpp b/wrapper/input.cpp index e34af4a..334a0ec 100644 --- a/wrapper/input.cpp +++ b/wrapper/input.cpp @@ -25,11 +25,12 @@ public ref struct MultiHandleDevice { System::String^ id; List<System::IntPtr>^ handles; - // Each element in the list returned has a distinct id + // Returned list represents the current connected raw input devices, + // where each device has a distinct device id // https://docs.microsoft.com/en-us/windows-hardware/drivers/install/device-ids - static List<MultiHandleDevice^>^ GetList() + static IList<MultiHandleDevice^>^ GetList() { - return ListMaker::MakeList(); + return ListMaker::MakeList()->AsReadOnly(); } ref class ListMaker { diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index 83804a2..6561fd2 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -695,19 +695,34 @@ public: return cfg; } - static DriverConfig^ GetDefault() + static DriverConfig^ FromProfile(Profile^ prof) { auto cfg = gcnew DriverConfig(); cfg->profiles = gcnew List<Profile^>(); cfg->accels = gcnew List<ManagedAccel^>(); cfg->devices = gcnew List<DeviceSettings^>(); - cfg->profiles->Add(gcnew Profile()); - cfg->accels->Add(gcnew ManagedAccel(default_driver_settings)); + cfg->profiles->Add(prof); + cfg->accels->Add(gcnew ManagedAccel(prof)); cfg->defaultDeviceConfig.Init(default_device_settings.config); return cfg; } + static DriverConfig^ GetDefault() + { + return FromProfile(gcnew Profile()); + } + + static void Deactivate() + { + try { + ra::reset(); + } + catch (const std::exception& e) { + throw gcnew InteropException(e); + } + } + private: DriverConfig() {} }; |