diff --git a/Cargo.toml b/Cargo.toml
index dea817d..f109ed2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ default-members = ["gui"]
[workspace.package]
edition = "2021"
-version = "0.3.1"
+version = "0.3.2"
authors = ["George Poulios"]
description = "A utility to control Razer DeathAdder v2 on Windows"
readme = "./README.md"
@@ -12,4 +12,5 @@ repository = "https://github.com/gpoulios/deathadderv2"
license = "GPLv2"
[workspace.dependencies]
-rgb = { version = "0.8.36" }
\ No newline at end of file
+rgb = { version = "0.8.36" }
+rusb = { version = "0.9" }
\ No newline at end of file
diff --git a/gui/Cargo.toml b/gui/Cargo.toml
index a777d05..8f6d31f 100644
--- a/gui/Cargo.toml
+++ b/gui/Cargo.toml
@@ -16,6 +16,8 @@ librazer = { path = "../lib" }
rgb = { workspace = true }
native-windows-gui = "1.0.13"
native-windows-derive = "1.0.5"
+rusb = { workspace = true }
+hidapi-rusb = "1.3.2"
[dependencies.windows]
version = "0.46.0"
@@ -24,4 +26,7 @@ features = [
"Win32_UI_Controls_Dialogs",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Diagnostics_Debug"
-]
\ No newline at end of file
+]
+
+[build-dependencies]
+embed-resource = "2.0.0"
\ No newline at end of file
diff --git a/gui/build.rs b/gui/build.rs
new file mode 100644
index 0000000..c48e8b1
--- /dev/null
+++ b/gui/build.rs
@@ -0,0 +1,4 @@
+use embed_resource;
+fn main() {
+ embed_resource::compile("gui.rc", embed_resource::NONE);
+}
\ No newline at end of file
diff --git a/gui/gui.exe.manifest b/gui/gui.exe.manifest
new file mode 100644
index 0000000..5bbe480
--- /dev/null
+++ b/gui/gui.exe.manifest
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/gui/gui.rc b/gui/gui.rc
new file mode 100644
index 0000000..dd6749e
--- /dev/null
+++ b/gui/gui.rc
@@ -0,0 +1,2 @@
+#define RT_MANIFEST 24
+1 RT_MANIFEST "gui.exe.manifest"
\ No newline at end of file
diff --git a/gui/src/gui.rs b/gui/src/gui.rs
index b2ad88d..84af800 100644
--- a/gui/src/gui.rs
+++ b/gui/src/gui.rs
@@ -1,6 +1,10 @@
#![windows_subsystem = "windows"]
-use std::cell::RefCell;
+use std::sync::Arc;
+use std::ptr;
+use std::{cell::RefCell, sync::Mutex};
+use std::thread;
+use hidapi_rusb::{HidError, HidApi, HidDevice};
use windows::{
core::{s, PCSTR},
Win32::{
@@ -13,7 +17,7 @@ use windows::{
WindowsAndMessaging::{SendMessageA, GetWindowLongA, SetWindowLongA,
GWL_STYLE, MessageBoxA, MB_OK, MB_ICONERROR, BS_TOP,
SetCursor, LoadCursorW, IDC_HAND, IDC_ARROW,
- WM_GETMINMAXINFO, MINMAXINFO
+ WM_GETMINMAXINFO, MINMAXINFO,
},
},
},
@@ -25,7 +29,7 @@ use nwg::{NativeUi, RadioButtonState};
use rgb::RGB8;
use librazer::{cfg::Config, device::UsbDevice, common::PollingRate};
-use librazer::device::{DeathAdderV2, RazerMouse};
+use librazer::device::{DeathAdderV2, RazerDevice, RazerMouse};
pub mod color_chooser;
use color_chooser::ColorDialog;
@@ -322,9 +326,21 @@ pub struct DeathAdderv2App {
)]
chk_samebright: nwg::CheckBox,
+ /*
+ * Events coming from the device
+ */
+ #[nwg_control]
+ #[nwg_events(OnNotice: [DeathAdderv2App::update_dpi_selection])]
+ dev_dpi_notice: nwg::Notice,
+ dev_dpi_thread: RefCell