Answer the question
In order to leave comments, you need to log in
keyboard input | How to clear the input stream in this case?
There is a menu that I navigate using the keyboard module
. In this case, to go to the item, you need to press z + x, press and that's what happens.
"zx" has already been written to the input stream
# Основной файл с хоткеями для передвижения по меню
keyboard.add_hotkey('up', menu.Up)
keyboard.add_hotkey('down', menu.Down)
keyboard.add_hotkey('z+x', menu.GoingToItemMenu)
keyboard.wait()
# Кусок файла с классом Menu
def GoingToItemMenu(self):
if self.selected == 1:
keyboard.clear_all_hotkeys()
logic.Registation()
#Файл logic
Users = []
def Registation():
login = input("Введите логин: ")
password = input("Введите пароль: ")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question