I am building a device that emulates an off the shelf USB device. The target system is Linux Mint. I am attempting to build the device in a way that requires zero changes to the host system. i.e. plug and play. This device consists of 4 buttons, 3 pots, 3 LEDs, 2 rotary switches and an encoder. The target system is using EVDEV routines in python. I am using a Teensy 4.1. I do not have access to the off the shelf device.
I have developed custom modifications to the core libraries to support this new device. The target system and software see this device as the off the shelf device that I am trying to emulate and is operating as expected when the controls are moved. i.e. When the pots are turned, sliders move on the screen. When the rotary switches are moved selections change on the screen. When the encoder is moved numbers increment on the target system. That part is working great.
The problem is that I am using X, Y and Z axis for the pots. EVDEV sees these as ABS_X, ABS_Y and ABS_Z. When I move these pots, not only does the system react correctly, but the mouse pointer jumps to X zero on the screen and moves with the pot. Same with the Y axis. Oddly this does not happen in windows. The mouse movement is not desired. I only want the target software to see the movement, not the mouse.
As a start, I'm posting my usb_report_descriptor. I'm assuming at this point that the problem is there.
I have developed custom modifications to the core libraries to support this new device. The target system and software see this device as the off the shelf device that I am trying to emulate and is operating as expected when the controls are moved. i.e. When the pots are turned, sliders move on the screen. When the rotary switches are moved selections change on the screen. When the encoder is moved numbers increment on the target system. That part is working great.
The problem is that I am using X, Y and Z axis for the pots. EVDEV sees these as ABS_X, ABS_Y and ABS_Z. When I move these pots, not only does the system react correctly, but the mouse pointer jumps to X zero on the screen and moves with the pot. Same with the Y axis. Oddly this does not happen in windows. The mouse movement is not desired. I only want the target software to see the movement, not the mouse.
As a start, I'm posting my usb_report_descriptor. I'm assuming at this point that the problem is there.
Code:
static uint8_t console_report_desc[] = {
0x05, 0x0C, // Usage Page (Consumer)
0x09, 0x01, // Usage (Consumer Control)
0xA1, 0x01, // Collection (Application)
0xA1, 0x02, // Collection (Logical)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x08, // Usage Maximum (0x08)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x35, 0x00, // Physical Minimum (0)
0x45, 0x01, // Physical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x10, // Report Count (16)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65534)
0x75, 0x10, // Report Size (16)
0x95, 0x0B, // Report Count (11)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x33, // Usage (Rx)
0x09, 0x34, // Usage (Ry)
0x09, 0x35, // Usage (Rz)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x40, // Usage (Vx)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
// SAG --------- Below is for sending keyboard key codes.
0x05, 0x07, // Usage Page (Key Codes),
0x75, 0x01, // Report Size (1),
0x95, 0x08, // Report Count (8),
0x09, 0xE2, // Left Alt
0x09, 0x09, // f
0x09, 0x29, // esc
0x09, 0x28, // enter
0x09, 0x3A, // F1
0x09, 0x3B, // F2
0x09, 0x3C, // F3
0x09, 0x3D, // F4
0x15, 0x00, // Logical Minimum (0),
0x25, 0x01, // Logical Maximum (1),
0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier keys
// SAG ------------
0xC0, // End Collection
0xC0, // End Collection
};