v1.8.13: fix entry_undo Cyrillic bind crash
tkinter rejects Cyrillic chars in bind(). Use keycode-based <Control-Key> dispatch instead (same approach as terminal_widget). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,9 +46,15 @@ def enable_undo(ctk_entry):
|
|||||||
_recording[0] = True
|
_recording[0] = True
|
||||||
return "break"
|
return "break"
|
||||||
|
|
||||||
|
def _on_ctrl_key(event):
|
||||||
|
"""Route Ctrl+key by physical keycode (layout-independent)."""
|
||||||
|
if event.keycode == 90: # Z
|
||||||
|
return _undo(event)
|
||||||
|
if event.keycode == 89: # Y
|
||||||
|
return _redo(event)
|
||||||
|
return None
|
||||||
|
|
||||||
entry.bind("<KeyRelease>", _snapshot, add="+")
|
entry.bind("<KeyRelease>", _snapshot, add="+")
|
||||||
entry.bind("<Control-z>", _undo)
|
entry.bind("<Control-z>", _undo)
|
||||||
entry.bind("<Control-y>", _redo)
|
entry.bind("<Control-y>", _redo)
|
||||||
# Support Russian keyboard layout (Cyrillic keycodes)
|
entry.bind("<Control-Key>", _on_ctrl_key)
|
||||||
entry.bind("<Control-\u044f>", _undo) # Ctrl+Я (z position on Russian layout)
|
|
||||||
entry.bind("<Control-\u043d>", _redo) # Ctrl+Н (y position on Russian layout)
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"""Version info for ServerManager."""
|
"""Version info for ServerManager."""
|
||||||
|
|
||||||
__version__ = "1.8.12"
|
__version__ = "1.8.13"
|
||||||
__app_name__ = "ServerManager"
|
__app_name__ = "ServerManager"
|
||||||
__author__ = "aibot777"
|
__author__ = "aibot777"
|
||||||
__description__ = "Desktop GUI for managing remote servers"
|
__description__ = "Desktop GUI for managing remote servers"
|
||||||
|
|||||||
Reference in New Issue
Block a user