summaryrefslogtreecommitdiffhomepage
path: root/proto-libevdev/ftnoir_protocol_libevdev.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-libevdev/ftnoir_protocol_libevdev.cpp')
-rw-r--r--proto-libevdev/ftnoir_protocol_libevdev.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/proto-libevdev/ftnoir_protocol_libevdev.cpp b/proto-libevdev/ftnoir_protocol_libevdev.cpp
index 5b07beff..fefcd9bb 100644
--- a/proto-libevdev/ftnoir_protocol_libevdev.cpp
+++ b/proto-libevdev/ftnoir_protocol_libevdev.cpp
@@ -55,6 +55,11 @@ evdev::evdev()
CHECK_LIBEVDEV(libevdev_enable_property(dev, INPUT_PROP_BUTTONPAD));
libevdev_set_name(dev, "opentrack headpose");
+
+ libevdev_set_id_bustype(dev, 3);
+ libevdev_set_id_vendor(dev, 4324);
+ libevdev_set_id_product(dev, 3798);
+ libevdev_set_id_version(dev, 123);
struct input_absinfo absinfo;
@@ -120,7 +125,7 @@ void evdev::pose(const double* headpose, const double*) {
for (int i = 0; i < 6; i++)
{
int value = (int)(headpose[i] * mid_input / max_value[i] + mid_input);
- int normalized = clamp(value, min_input, max_input);
+ int normalized = std::clamp(value, min_input, max_input);
(void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], normalized);
}