Repository: autokey/autokey

Issue #29: Cannot paste via keyboard, cannot make not-english abbreviation.
Created: 2016-07-14T16:24:13Z
Version and env:
$ pip freeze | grep -E "autokey|xlib"
autokey-py3==0.93.4
python3-xlib==0.15

$ cat /etc/*release* | grep "VERSION="
VERSION="16.04 LTS (Xenial Xerus)"

$ uname -r       
4.4.0-28-generic

GTK
ii  libgtk-3-0:amd64       3.18.9-1ubuntu3.1                    amd64
ii  libgtk2.0-0:amd64      2.24.30-1ubuntu1                     amd64

Some warnings:
/home/dm/.local/lib/python3.5/site-packages/autokey/gtkapp.py:24: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk, GObject, GLib

/home/dm/.local/lib/python3.5/site-packages/autokey/gtkui/notifier.py:19: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk, Notify

/home/dm/.local/lib/python3.5/site-packages/autokey/gtkui/notifier.py:30: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3

/home/dm/.local/lib/python3.5/site-packages/autokey/gtkui/configwindow.py:20: PyGIWarning: GtkSource was imported without specifying a version first. Use gi.require_version('GtkSource', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Pango, GtkSource, Gdk, Gio

And some errors:
I edit /home/dm/.local/lib/python3.5/site-packages/autokey/interface.py
Traceback (most recent call last):
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 502, in __sendStringClipboard
    self.__fillClipboard(string)
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 542, in __fillClipboard
    self.clipBoard.set_text(string)

because have error when trying to use abbreviatations
Traceback (most recent call last):
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 502, in __sendStringClipboard
    self.__fillClipboard(string)
  File "/home/dm/.local/lib/python3.5/site-packages/autokey/interface.py", line 542, in __fillClipboard
    self.clipBoard.set_text(string)
TypeError: Gtk.Clipboard.set_text() takes exactly 3 arguments (2 given)

in methonds def __fillSelection(self, string): and def __fillClipboard(self, string):
use self.selection.set_text(string, -1) and self.clipBoard.set_text(string, -1)
Problems:
I use russian and english keyboard layout and the main problems for me that i cannot:

use Paste using - Keyboard - nothing happens in this variant. Program paste only dots and commas and text in english + digits, not text in russian. For example i have abbreviation 123 for 1,2,3:hello!йцукенг98 and it paste only 1,2,3:hello!98 but if i use option Paste using - Clipboard (Shift+Insert) i get - 1,2,3:hello!йцукенг98 Yippee!

Perhaps in this variant i cannot use <cursor> because it paste with option Paste using - Clipboard (Shift+Insert) - <left><left><left><left><left><left><left><left> for positioning cursor, but cursor always at the end of string.

cannot add abbreviation in russian - if i need йцу for йцукенг i need choose Paste using - Clipboard (Shift+Insert) and make abbreviation qwe - the same buttons on physical keyboards but with english layout, so i need script that add in ~/.config/autokey/data/My Phrases/.йцукенг.json in section"abbreviations": ["\u0439\u0446\u0443"] my qwe.

>>> print(u"\u0439\u0446\u0443")
йцу

Can help to change abbreviation from selection script to add 2 abbreviation to phrase - \u0439\u0446\u0443 and analog physical key in english qwe?

Log for Paste using - Keyboard phrase - 1,2,3:hello!<cursor>йцукенг98 and it paste only 1,2,3:hello!98 with cursor in bad position (where _) 1,2,3_:hello!98
2016-07-14 19:13:39,880 INFO - root - Initialising application
2016-07-14 19:13:39,885 INFO - root - Initialise global hotkeys
2016-07-14 19:13:39,886 INFO - config-manager - Loading config from existing file: /home/dm/.config/autokey/autokey.json
2016-07-14 19:13:39,886 DEBUG - config-manager - Loading folder at '/home/dm/.config/autokey/data/My Phrases'
2016-07-14 19:13:39,888 DEBUG - config-manager - Loading folder at '/home/dm/.config/autokey/data/Sample Scripts'
2016-07-14 19:13:39,889 INFO - config-manager - Configuration changed - rebuilding in-memory structures
2016-07-14 19:13:39,889 DEBUG - inotify - Adding watch for /home/dm/.config/autokey/data/My Phrases
2016-07-14 19:13:39,890 DEBUG - inotify - Adding watch for /home/dm/.config/autokey/data/Sample Scripts
2016-07-14 19:13:39,890 INFO - config-manager - Successfully loaded configuration
2016-07-14 19:13:39,890 DEBUG - inotify - Adding watch for /home/dm/.config/autokey/data
2016-07-14 19:13:39,890 DEBUG - inotify - Adding watch for /home/dm/.config/autokey
2016-07-14 19:13:39,890 DEBUG - config-manager - Global settings: {'showToolbar': True, 'notificationIcon': 'autokey-status', 'recordTimingThreshold': 0.1, 'interfaceType': 'XRecord', 'promptToSave': True, 'serviceRunning': True, 'workAroundApps': '.*VirtualBox.*|krdc.Krdc', 'hPanePosition': 489, 'menuTakesFocus': False, 'showTrayIcon': True, 'scriptGlobals': {}, 'sortByUsageCount': True, 'windowDefaultSize': [1920, 1034], 'triggerItemByInitial': False, 'undoUsingBackspace': True, 'columnWidths': [150, 50, 100], 'enableQT4Workaround': False, 'isFirstRun': True}
2016-07-14 19:13:39,890 INFO - service - Starting service
2016-07-14 19:13:39,909 DEBUG - interface - Modifier masks: {'<numlock>': 16, '<super>': 64, '<shift>': 1, '<hyper>': 64, '<alt>': 8, '<meta>': 8, '<ctrl>': 4, '<alt_gr>': 128, '<capslock>': 2}
2016-07-14 19:13:39,940 DEBUG - interface - Alt-Grid: XK_Alt_R, 65514
2016-07-14 19:13:39,940 DEBUG - interface - [(92, 0), (92, 2)]
2016-07-14 19:13:39,940 DEBUG - interface - X Server Keymap
2016-07-14 19:13:39,940 DEBUG - interface - [\] : [(51, 0), (51, 2)]
2016-07-14 19:13:39,940 DEBUG - interface - [|] : [(51, 1), (94, 3), (94, 4)]
2016-07-14 19:13:39,940 DEBUG - interface - [`] : [(49, 0)]
2016-07-14 19:13:39,940 DEBUG - interface - [1] : [(10, 0), (10, 2)]
2016-07-14 19:13:39,940 DEBUG - interface - [2] : [(11, 0), (11, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [3] : [(12, 0), (12, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [4] : [(13, 0), (13, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [5] : [(14, 0), (14, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [6] : [(15, 0), (15, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [7] : [(16, 0), (16, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [8] : [(17, 0), (17, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [9] : [(18, 0), (18, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [0] : [(19, 0), (19, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [-] : [(20, 0), (20, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [=] : [(21, 0), (21, 2)]
2016-07-14 19:13:39,941 DEBUG - interface - [~] : [(49, 1)]
2016-07-14 19:13:39,941 DEBUG - interface - [!] : [(10, 1), (10, 3)]
2016-07-14 19:13:39,941 DEBUG - interface - [@] : [(11, 1)]
2016-07-14 19:13:39,941 DEBUG - interface - [#] : [(12, 1)]
2016-07-14 19:13:39,941 DEBUG - interface - [$] : [(13, 1)]
2016-07-14 19:13:39,941 DEBUG - interface - [%] : [(14, 1), (14, 3)]
2016-07-14 19:13:39,941 DEBUG - interface - [^] : [(15, 1)]
2016-07-14 19:13:39,942 DEBUG - interface - [&] : [(16, 1)]
2016-07-14 19:13:39,942 DEBUG - interface - [*] : [(17, 1), (17, 3)]
2016-07-14 19:13:39,942 DEBUG - interface - [(] : [(187, 0), (18, 1), (187, 2), (18, 3)]
2016-07-14 19:13:39,942 DEBUG - interface - [)] : [(188, 0), (19, 1), (188, 2), (19, 3)]
2016-07-14 19:13:39,942 DEBUG - interface - [q] : [(24, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [w] : [(25, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [e] : [(26, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [r] : [(27, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [t] : [(28, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [y] : [(29, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [u] : [(30, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [i] : [(31, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [o] : [(32, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [p] : [(33, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [[] : [(34, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - []] : [(35, 0)]
2016-07-14 19:13:39,942 DEBUG - interface - [a] : [(38, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [s] : [(39, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [d] : [(40, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [f] : [(41, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [g] : [(42, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [h] : [(43, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [j] : [(44, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [k] : [(45, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [l] : [(46, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [;] : [(47, 0), (13, 3)]
2016-07-14 19:13:39,943 DEBUG - interface - ['] : [(48, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [z] : [(52, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [x] : [(53, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [c] : [(54, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [v] : [(55, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [b] : [(56, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [n] : [(57, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [m] : [(58, 0)]
2016-07-14 19:13:39,943 DEBUG - interface - [,] : [(59, 0), (61, 3)]
2016-07-14 19:13:39,944 DEBUG - interface - [.] : [(60, 0), (61, 2)]
2016-07-14 19:13:39,944 DEBUG - interface - [/] : [(61, 0), (94, 2), (51, 3)]
2016-07-14 19:13:39,944 DEBUG - interface - [Q] : [(24, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [W] : [(25, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [E] : [(26, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [R] : [(27, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [T] : [(28, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [Y] : [(29, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [U] : [(30, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [I] : [(31, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [O] : [(32, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [P] : [(33, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [{] : [(34, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [}] : [(35, 1)]
2016-07-14 19:13:39,944 DEBUG - interface - [A] : [(38, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [S] : [(39, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [D] : [(40, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [F] : [(41, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [G] : [(42, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [H] : [(43, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [J] : [(44, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [K] : [(45, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [L] : [(46, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [:] : [(47, 1), (15, 3)]
2016-07-14 19:13:39,945 DEBUG - interface - ["] : [(48, 1), (11, 3)]
2016-07-14 19:13:39,945 DEBUG - interface - [Z] : [(52, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [X] : [(53, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [C] : [(54, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [V] : [(55, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [B] : [(56, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [N] : [(57, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [M] : [(58, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [<] : [(94, 0), (59, 1)]
2016-07-14 19:13:39,945 DEBUG - interface - [>] : [(60, 1), (94, 1)]
2016-07-14 19:13:39,946 DEBUG - interface - [?] : [(61, 1), (16, 3)]
2016-07-14 19:13:39,946 DEBUG - iomediator - Set modifier <capslock> to False
2016-07-14 19:13:39,946 DEBUG - iomediator - Set modifier <numlock> to True
2016-07-14 19:13:39,948 DEBUG - interface - Grabbing hotkey: ['<super>'] 'k'
2016-07-14 19:13:39,948 DEBUG - interface - Grabbing hotkey: ['<shift>', '<super>'] 'k'
2016-07-14 19:13:39,948 DEBUG - interface - Grabbing hotkey: ['<super>'] 'z'
2016-07-14 19:13:39,954 INFO - interface - XRecord interface thread starting
2016-07-14 19:13:39,954 INFO - service - Service now marked as running
2016-07-14 19:13:40,015 DEBUG - phrase-menu - Sorting phrase menu by usage count
2016-07-14 19:13:40,016 DEBUG - phrase-menu - Triggering menu item by position in list
2016-07-14 19:13:40,019 INFO - root - Entering main()
2016-07-14 19:13:46,761 DEBUG - service - Received mouse click - resetting buffer
2016-07-14 19:13:47,949 DEBUG - service - Raw key: '1', modifiers: [], Key: 1
2016-07-14 19:13:47,950 DEBUG - service - Window visible title: 'New Issue · guoci/autokey-py3 - Mozilla Firefox', Window class: 'Navigator.Firefox'
2016-07-14 19:13:47,950 DEBUG - service - No phrase/script matched hotkey
2016-07-14 19:13:47,950 DEBUG - service - Input stack at end of handle_keypress: deque(['1'], maxlen=150)
2016-07-14 19:13:48,077 DEBUG - service - Raw key: '2', modifiers: [], Key: 2
2016-07-14 19:13:48,077 DEBUG - service - Window visible title: 'New Issue · guoci/autokey-py3 - Mozilla Firefox', Window class: 'Navigator.Firefox'
2016-07-14 19:13:48,077 DEBUG - service - No phrase/script matched hotkey
2016-07-14 19:13:48,077 DEBUG - service - Input stack at end of handle_keypress: deque(['1', '2'], maxlen=150)
2016-07-14 19:13:48,317 DEBUG - service - Raw key: '3', modifiers: [], Key: 3
2016-07-14 19:13:48,318 DEBUG - service - Window visible title: 'New Issue · guoci/autokey-py3 - Mozilla Firefox', Window class: 'Navigator.Firefox'
2016-07-14 19:13:48,318 DEBUG - service - No phrase/script matched hotkey
2016-07-14 19:13:48,318 DEBUG - service - Input stack at end of handle_keypress: deque(['1', '2', '3'], maxlen=150)
2016-07-14 19:13:49,093 DEBUG - service - Raw key: ' ', modifiers: [], Key:  
2016-07-14 19:13:49,093 DEBUG - service - Window visible title: 'New Issue · guoci/autokey-py3 - Mozilla Firefox', Window class: 'Navigator.Firefox'
2016-07-14 19:13:49,093 DEBUG - service - No phrase/script matched hotkey
2016-07-14 19:13:49,093 DEBUG - iomediator - Send via event interface
2016-07-14 19:13:49,094 DEBUG - service - Input stack at end of handle_keypress: deque([], maxlen=150)
2016-07-14 19:13:49,094 DEBUG - service - Ignored locking error in handle_keypress
2016-07-14 19:13:49,095 DEBUG - interface - Send special key: ['<backspace>']
2016-07-14 19:13:49,096 DEBUG - interface - Send special key: ['<backspace>']
2016-07-14 19:13:49,096 DEBUG - interface - Send special key: ['<backspace>']
2016-07-14 19:13:49,097 DEBUG - interface - Send special key: ['<backspace>']
2016-07-14 19:13:49,097 DEBUG - interface - Sending string: '1,2,3:hello!йцукенг98 '
2016-07-14 19:13:49,102 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,102 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,103 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,103 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,104 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,105 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,105 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,106 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,106 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:49,107 DEBUG - interface - Send special key: ['<left>']
2016-07-14 19:13:53,257 DEBUG - service - Received mouse click - resetting buffer
2016-07-14 19:13:54,024 DEBUG - service - Received mouse click - resetting buffer
2016-07-14 19:13:54,122 INFO - root - Shutting down
2016-07-14 19:13:54,122 INFO - service - Service shutting down
2016-07-14 19:13:55,120 INFO - config-manager - Persisting configuration
2016-07-14 19:13:55,120 INFO - config-manager - Backing up existing config file
2016-07-14 19:13:55,121 DEBUG - inotify - Reporting IN_MODIFY event at /home/dm/.config/autokey/autokey.json~
2016-07-14 19:13:55,121 DEBUG - inotify - Reporting IN_MODIFY event at /home/dm/.config/autokey/autokey.json~
2016-07-14 19:13:55,122 DEBUG - inotify - Reporting IN_MODIFY event at /home/dm/.config/autokey/autokey.json
2016-07-14 19:13:55,122 INFO - config-manager - Finished persisting configuration - no errors
2016-07-14 19:13:55,123 DEBUG - inotify - Reporting IN_MODIFY event at /home/dm/.config/autokey/autokey.json
2016-07-14 19:13:56,124 INFO - inotify - Shutting down file monitor
2016-07-14 19:13:56,124 DEBUG - root - All shutdown tasks complete... quitting

Duplicate issue #49: Special characters in "Paste using Keyboard"
Created: 2016-12-11T04:27:49Z
Setup

New phrase with text "1—2" (an em dash symbol)
Set to "Paste using Keyboard" (the default)
Set a hotkey (as on Mac, alt+shift+hyphen)

Actual/Expected
When I run this, the text will write as "12" as if the em dash was not there. Same if there was nothing besides the em dash in the phrase (nothing would write from the keyboard). The workaround is to Paste using Clipboard, but I imagine this is a bug.
Latest Manjaro 16.10.1, kernel 4.8.9

Closing comment (2016-12-11T05:09:04Z): Related/duplicate of #29