增加键位

main
Dawn_Ocean 2023-10-19 21:08:27 +08:00
parent 90d6668280
commit 861ad5294e
2 changed files with 15 additions and 8 deletions

View File

@ -3,11 +3,18 @@
# 文件以 '$' 号单独占一行结束,请勿删除
# 映射配置格式:[按钮编号]:[键位]
0 : Q
1 : W
2 : E
3 : R
4 : T
5 : Y
A0 : Q
A1 : W
A2 : E
A3 : R
A4 : T
A5 : Y
D2 : U
D3 : I
D4 : O
D5 : P
D6 : [
D7 : ]
$

View File

@ -31,7 +31,7 @@ def detect():
def com_simulate(message):
print(message)
key = maps[int(message[1])] # 判断按下了哪个按钮
key = maps[message[0:2]] # 判断按下了哪个按钮
if 'U' in message:
keyUp(key)
elif 'D' in message:
@ -52,7 +52,7 @@ if __name__ == "__main__":
while line != "$":
if line:
keymap = line.split(':')
maps[int(keymap[0].strip())] = keymap[1].strip()
maps[keymap[0].strip()] = keymap[1].strip()
line = f.readline().strip().split('#')[0]
print("构建完毕!")