我正在尝试制作键盘,但我只想使用小键盘和那里的按钮使其工作,但是我的代码似乎不适用于 a 和 b 部分。我评论了哪一部分。
if "1" in line:
if kytype == 'a':
kytype = "k"
elif kytype == 'b': #when this part is runned it prints a 'b' instead
kytype == "u" # of a 'u'
elif kytype == " ":
kytype = "a"
elif "2" in line:
if kytype == 'a':
kytype = "l"
elif kytype == 'b':
kytype == "v" #it happens here too and instead of printing a
elif kytype == " ": # 'v' it prints a 'b'
kytype = "b"
#I haven't done the rest of the code for other letters because of the
#problem
elif line = 'ins':
print(kytype)
kytype = " "