Add support for Cyrillic characters in get_keys()

This commit is contained in:
vvihorev 2024-04-05 18:32:00 +02:00
parent 790a06cf2b
commit d8d559a6e9

View file

@ -91,6 +91,10 @@ class View:
for _ in range(MAX_KEYBINDING_LENGTH):
ch = self.stdscr.getch()
if ch == 208 or ch == 209:
second_ch = self.stdscr.getch()
key = (ch.to_bytes() + second_ch.to_bytes()).decode('utf-8')
else:
log.info("raw ch without unctrl: %s", ch)
try:
key = curses.unctrl(ch).decode()