marcelhoffs / input-switcher

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

Logitech K780 and script to find the right command for your device #15

Open gabrielstelmach opened 1 year ago

gabrielstelmach commented 1 year ago

Hi guys, inspired by this post, I created a batch script to discover what is the command line to switch not documented Logitech devices.

Using the script I could find the command for Logitech K780 as below: hidapitester --vidpid 046D:C52B --usage 0x0001 --usagePage 0xFF00 --open --length 7 --send-output 0x10,0x01,0x08,0x10,0x01,0x00,0x00

How to use:

  1. Copy both files to the same folder where input-switcher is located. Usually: C:\Program Files\InputSwitcher
  2. Open a Command prompt window and run BruteForceDiscover.bat
  3. Grab a beer and wait until your device is switched to channel 2.
  4. Having found the right pair of values, just update the original script file switch_to_2.bat with the ones from step 3.

Come considerations. Although simple, the process is heavily manual as I didn't spend much time on this, all I wanted was to make my own setup work. So, feel free to improve as needed.

DecToHex.bat BruteForceDiscover.bat

hlz-922 commented 1 year ago

My configurations are Channel 1: one unifying receiver connecting MX keys and MX anywhere 3 to Windows PC. Channel 2: one unifying receiver connecting MX keys and MX anywhere 3 to MacBook.

I couldn't follow the instructions to find C and D in the original repo README file because I'm connecting Windows and Mac. So I tried your brute force bat: it ran all the combinations but still didn't manage to switch to channel 2... Do the two devices need to be connected to the same network??

gabrielstelmach commented 1 year ago

Do the two devices need to be connected to the same network??

As far as I understand the way the application works, it is not necessary to have both devices in the same network as the receiver will only communicate using Bluetooth signal. In case the execution has completed all the sequences without switching the channel, I wonder if hidapitester.exe is compatible with your receiver.

hlz-922 commented 1 year ago

Yes they don't need to be connected to the same network. I just figured out how to switch between two devices! I basically followed @arjunchhabra settings on this post. I think my B was also wrong, that's why your script didn't work for me!