Featured image of post Linux-Windows共用鼠标

Linux-Windows共用鼠标

前言

笔者使用的是罗技的M337低功耗鼠标,但是在更换系统时必须要重新链接,非常影响使用体验.

准备

在Linux下连接,后在Windows下连接,然后重启到linux

1
2
3
4
5
yay -S chntpw
mount /dev/nvme0n1p5
cd /mnt/Windows/C/Windows/System32/config

chntpw -e SYSTEM

然后输入

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cd ControlSet001
cd Services
cd BTHPORT
cd Parameters
cd Keys

ls


(...)\Services\BTHPORT\Parameters\Keys> ls
Node has 1 subkeys and 0 values
  key name
  <c0bxxxxxx47a>

cd c0bxxxxxx47a

#这里的mac地址记录下来备用

ls
(...)\BTHPORT\Parameters\Keys\c0b88377e47a> ls
Node has 0 subkeys and 1 values
  size     type              value name             [value if type DWORD]
    16  3 REG_BINARY         <3488xxxxx301>

和普通蓝牙鼠标不同,没有网上的其他项目,只有一个hex值

然后就解码这个hex值.

1
2
3
4
hex 3488xxxxx301

Value <34885de70301> of type REG_BINARY (3), data length 16 [0x10]
:00000  9A 9B 0X 0X 0X F7 X0 34 D6 XX C6 00 72 00 49 05 ...,...4....r.I.

将这个值复制出来.

然后查看已连接的设备

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
sudo ls /var/lib/bluetooth

2F:1D:8F:1D:F6:F6


sudo ls /var/lib/bluetooth/2F:1D:8F:1D:F6:F6

	1C:CC:00:4A:FC:E6  cache  settings


# 如果mac和刚刚看到的不一样,就把它改名为刚才的那个值

sudo nano /var/lib/bluetooth/2F:1D:8F:1D:F6:F6/1C:CC:00:4A:FC:E6/info

# 找到info中的配置文件,修改LinkKey中的数据

# 重启服务
sudo systemctl restart bluetooth

然后就不需要每次开电脑重连了捏

w

所念皆星河
Built with Hugo
主题 StackJimmy 设计

提供全站CDN服务