diff --git a/References/Steam Controller/Descriptor.txt b/References/Steam Controller/Descriptor.txt new file mode 100644 index 0000000..42b6914 --- /dev/null +++ b/References/Steam Controller/Descriptor.txt @@ -0,0 +1,73 @@ +Select the device event number [0-17]: 17 +Input driver version is 1.0.1 +Input device ID: bus 0x3 vendor 0x28de product 0x1102 version 0x111 +Input device name: "Steam Controller" +Supported events: + Event type 0 (EV_SYN) + Event type 1 (EV_KEY) + Event code 289 (BTN_THUMB) + Event code 290 (BTN_THUMB2) + Event code 304 (BTN_SOUTH) + Event code 305 (BTN_EAST) + Event code 307 (BTN_NORTH) + Event code 308 (BTN_WEST) + Event code 310 (BTN_TL) + Event code 311 (BTN_TR) + Event code 312 (BTN_TL2) + Event code 313 (BTN_TR2) + Event code 314 (BTN_SELECT) + Event code 315 (BTN_START) + Event code 316 (BTN_MODE) + Event code 317 (BTN_THUMBL) + Event code 318 (BTN_THUMBR) + Event code 336 (BTN_GEAR_DOWN) + Event code 337 (BTN_GEAR_UP) + Event code 544 (BTN_DPAD_UP) + Event code 545 (BTN_DPAD_DOWN) + Event code 546 (BTN_DPAD_LEFT) + Event code 547 (BTN_DPAD_RIGHT) + Event type 3 (EV_ABS) + Event code 0 (ABS_X) + Value 0 + Min -32767 + Max 32767 + Resolution 51 + Event code 1 (ABS_Y) + Value 0 + Min -32767 + Max 32767 + Resolution 51 + Event code 3 (ABS_RX) + Value 0 + Min -32767 + Max 32767 + Fuzz 256 + Resolution 1638 + Event code 4 (ABS_RY) + Value 0 + Min -32767 + Max 32767 + Fuzz 256 + Resolution 1638 + Event code 16 (ABS_HAT0X) + Value 0 + Min -32767 + Max 32767 + Fuzz 256 + Resolution 1638 + Event code 17 (ABS_HAT0Y) + Value 0 + Min -32767 + Max 32767 + Fuzz 256 + Resolution 1638 + Event code 20 (ABS_HAT2X) + Value 0 + Min 0 + Max 255 + Resolution 51 + Event code 21 (ABS_HAT2Y) + Value 0 + Min 0 + Max 255 + Resolution 51 \ No newline at end of file diff --git a/input_dev.c b/input_dev.c index d07d020..f4a2f44 100644 --- a/input_dev.c +++ b/input_dev.c @@ -166,10 +166,13 @@ static void* input_read_thread_func(void* ptr) { if (rc == 0) { const int is_syn = (read_ev.type == EV_SYN) && (read_ev.code == SYN_REPORT); - if ((read_ev.code == MSC_TIMESTAMP) && (read_ev.type == EV_MSC)) { - // the output device will handle that - //printf("MSC_TIMESTAMP found. Ignoring...\n"); - continue; + if (read_ev.type == EV_MSC) { + if (read_ev.code == MSC_SCAN) { + continue; + } else if (read_ev.code == MSC_TIMESTAMP) { + // the output device will handle that + //printf("MSC_TIMESTAMP found. Ignoring...\n"); + } } if ((!has_syn) || ((has_syn) && (!is_syn))) { diff --git a/output_dev.h b/output_dev.h index 3feb529..e5ce798 100644 --- a/output_dev.h +++ b/output_dev.h @@ -2,10 +2,17 @@ #include "queue.h" +/* // Emulates a "Generic" controller: #define OUTPUT_DEV_NAME "Generic Controller XD" #define OUTPUT_DEV_VENDOR_ID 0x108c #define OUTPUT_DEV_PRODUCT_ID 0x0323 +*/ + +// Emulates a steam controller +#define OUTPUT_DEV_NAME "Steam Controller" +#define OUTPUT_DEV_VENDOR_ID 0x28de +#define OUTPUT_DEV_PRODUCT_ID 0x1102 /* //Emulates an Xbox one wireless controller: