Rob
unread,Jan 7, 2013, 9:25:35 AM1/7/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to plove...@googlegroups.com
Using Wiktionary, I've made a dictionary that outputs IPA.
Here's
a way to make it (sort of) work -- Linux only so far. In the latest
Plover codebase, change the function send_string(self, s) to the
following in plover/oslayer/xkeyboardcontrol.py:
def send_string(self, s):
"""Unicode-ish output hack"""
# shows "real" output on terminal
sys.stdout.write(s)
sys.stdout.flush()
for char in s:
# chosen arbitrarily
keycode = 253
ordchar = ord(char)
# keysyms for Unicode characters
if ordchar > 100:
ordchar += 0x01000000
self.display.change_keyboard_mapping(keycode, [{ordchar}])
self._send_keycode(keycode)
# so that keys in sequence do not overlap
sleep(0.05)
self.display.sync()
Obviously, a better way to do it would be to assign individual
keycodes to all IPA symbols. Makes me wonder how alphabets that are
bigger than 255-8 characters are handled, though -- perhaps using the
keycodes as a circular buffer.
Unfortunately, some symbols such
as ð do not appear as they should, but they are fixable with a
search-and-replace. The output of xev hints at XmbLookupString being the
culprit, but I didn't look into it further yet.
KeyPress event, serial 66, synthetic YES, window 0x3e00001,
root 0x15d, subw 0x0, time 0, (1,1), root:(1,1),
state 0x0, keycode 253 (keysym 0x10000f0, (no name)), same_screen YES,
XLookupString gives 2 bytes: (c3 b0) "ð"
XmbLookupString gives 1 bytes: (f0) "�"
XFilterEvent returns: False