Нужно в python приспособить pyautogui для русской раскладки

Вот такой код у меня сейчас. Помогите найти, что не так с кодом.

import pyautogui

def translate(key):
    """Returns qwerty key or the given key itself if no mapping found"""
    return "".join(map(lambda x: tr.get(x, x), key))

qwerty = """qwertyuiop[]asdfghjkl;'zxcvbnm,.?/QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>"""
ycuken = """йцукенгшщзхъфывапролджэячсмитьбю,.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ"""
# join as keys and values
tr = dict(zip(ycuken, qwerty))

# this will type the text
pyautogui.typewrite('Привет мир!\n', interval=0.1)

Ответы (0 шт):