marcelhoffs / input-switcher

Switch inputs with hidapitester (Windows & Linux)
403 stars 32 forks source link

MX Vertical & K380 Commands #39

Open JohnDavidAnthony opened 3 days ago

JohnDavidAnthony commented 3 days ago

I wanted to help out anyone who comes after me for this awesome tool. Here's the commands for my devices I used @gabrielstelmach's script to find the right C and D values.

connects over bluetooth.

`rem Switch K380 to channel 1 .\hidapitester -v --vidpid 046D:B342 --usage 0x0002 --usagePage 0xFF00 --open --length 20 --send-output 0x11,0x00,0x07,0x010,0x00,0x00,0x00

rem Switch MX Vertical 3 to channel 1 .\hidapitester.exe -v --vidpid 046D:B020 --usagePage 0xFF43 --usage 0x0202 --open --length 7 --send-output 0x11,0x00,0x0C,0x1C,0x00,0x00,0x00

rem Switch K380 to channel 3 .\hidapitester.exe -v --vidpid 046D:B342 --usage 0x0002 --usagePage 0xFF00 --open --length 20 --send-output 0x11,0x00,0x07,0x010,0x02,0x00,0x00

rem Switch MX Vertical 3 to channel 3 .\hidapitester.exe -v --vidpid 046D:B020 --usagePage 0xFF43 --usage 0x0202 --open --length 7 --send-output 0x11,0x00,0x0C,0x1C,0x02,0x00,0x00 `

luiscapobianco commented 1 day ago

I adapted a script I found on the Internet that worked with a USB-connected mouse and keyboard and made it work with my Bluetooth-connected devices.

I have the script in each computer and changed the destination computer variable assignment, finally, I assigned a mouse button to run the script.

The problem, it switches the focus of the app I am using to a terminal window. So I made (well Claude made for me) a MacOS app to do that.

Here is the shell script, test the command I am sending the mouse and keyboard on your devices.

Here is the last part in the shell script comments with the command I am sending to the devices. The file is in txt because I can´t attach a shell script file.

Search showed that for Bluetooth devices we need to send a load of 20 bytes A: Header B: Device ID, for Bluetooth is 0 as each device connects independently C: ID D: Constant E: Destination Channel from 0 to 2 (buttons 1 to 3) F: Filling

Mouse 0x11,0x00,0x0A,0x1E,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x11,0x00,0x0A,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

Keyboard 0x11,0x00,0x09,0x1E,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x11,0x00,0x09,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 switch.txt