pythonunicodekeyboardautokey

How to send a Unicode character with Autokey keyboard.sendkeys()?


I am trying to use Autokey-py3 v0.93.10 (in Linux Mint 18.2), to generate Unicode characters using the keyboard.send_keys command. Unfortunately none of the following attempts work.

keyboard.sendkeys("—")
keyboard.sendkeys(u"\u2014")

or this attempt copied from unicode.py:

import.paste_character("—")

Can someone advise me what I am missing?


Solution

  • This works for me (mostly):

    keyboard.send_keys("<ctrl>+<shift>+u+" + "012b")
    keyboard.send_keys("<ctrl>")
    

    It seems to depend on the app you are writing to, the desktop environment, the distro and the version thereof...

    For example, it is working now in this window - but it's not working inside LibreOffice Writer on KDE/Manjaro (although it was working there a few months ago).