1
0
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/radial-controller-protocol-implementation

With a little bit of trial and error (and a crash-course in how the heck
HID even works), I figured out how to get the dial to provide haptic
feedback!

Along the way, I also learned that you can take advantage of the
(incorrectly named) Resolution Multiplier field to customize how many
"steps" the dial should have, offloading the work to the device itself!

Very cool!!
This commit is contained in:
Daniel Prilik
2020-10-30 19:59:23 -04:00
parent 858209484f
commit e6fa6845fe
16 changed files with 1139 additions and 365 deletions

39
Cargo.lock generated
View File

@@ -1,5 +1,11 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "arc-swap"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]]
name = "arrayref"
version = "0.3.6"
@@ -148,6 +154,17 @@ dependencies = [
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]]
name = "hidapi"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c6ffb97f2ec5835ec73bcea5256fc2cd57a13c5958230778ef97f11900ba661"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -299,6 +316,26 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "signal-hook"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed"
dependencies = [
"libc",
"signal-hook-registry",
]
[[package]]
name = "signal-hook-registry"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
dependencies = [
"arc-swap",
"libc",
]
[[package]]
name = "strum"
version = "0.8.0"
@@ -320,7 +357,9 @@ name = "surface-dial-daemon"
version = "0.1.0"
dependencies = [
"evdev-rs",
"hidapi",
"notify-rust",
"signal-hook",
]
[[package]]