Add Enter key support for command input
- Bind Enter key to send command in interactive tab
This commit is contained in:
@@ -939,6 +939,9 @@ class SerialAppGUI(tk.Tk):
|
||||
self.command_entry = CustomEntry(input_frame, width=50)
|
||||
self.command_entry.pack(side=LEFT, padx=5)
|
||||
|
||||
# Привязываем обработчик нажатия Enter к полю ввода
|
||||
self.command_entry.bind('<Return>', lambda event: self.send_command())
|
||||
|
||||
# Кнопка отправки с иконкой
|
||||
send_btn = ttk.Button(
|
||||
input_frame,
|
||||
@@ -984,6 +987,7 @@ class SerialAppGUI(tk.Tk):
|
||||
if not cmd:
|
||||
return
|
||||
self.interactive_text.append_command(f"[CMD] {cmd}")
|
||||
self.command_entry.delete(0, END) # Очищаем поле ввода
|
||||
threading.Thread(target=self.process_command, args=(cmd,), daemon=True).start()
|
||||
|
||||
# Обработка команды
|
||||
|
||||
Reference in New Issue
Block a user