need help with an accessibility prototype

Eric S. Johansson esj at harvee.org
Fri May 22 16:46:08 EDT 2015



On 05/22/2015 03:50 PM, Laura Creighton wrote:
> In a message of Fri, 22 May 2015 12:29:20 -0400, "Eric S. Johansson" writes:
>> 2 needs.  first is determining if NaturallySpeaking injects keycodes or
>> ascii char into the windows input queue.  second is building a test
>> widget to capture and display text.
>>
>> I think I can solve both of these by building a simple text widget
>> (tkinter? qt? ??) to capture keycodes.  problem, is in <mumble><mumble>
>> yrs of programming, I've never written a GUI interface so I have no idea
>> where to start.  help, tutor, pointers to samples would be most welcome.
>>
>> --- eric
> The best online manual I know of for Tkinter is here:
> http://effbot.org/tkinterbook/ despite being 10 years old.  But then I
> haven't looked for one for about that long, either.
>
> For tkinter key events are a  bit odd, given that Tkinter tries to
> help you and considers special keys, punctuation and non-ascii printing
> characters as separate things should you want to bind to them.
>
> It's actually easier to write the code and say 'play with this' rather
> than to explain when you would need to use event.char and when event.keysym
> (Plus the code will tell you what Tkinter uses, I might remember wrong.)
>
> Save this in a file and run it.

Wow. What a gift. It told me what I needed to know which is the key syms 
are generated in a way that makes sense to me as far as I understand them.

A bit of background. I have some Linux resident code that translates 
standard input characters into key codes and then feeds them into 
uinput.   the problem is, the character sequences generated by 
NaturallySpeaking plus Windows doesn't always work right or as expected. 
In theory, I should now be able to push the individual events over to 
the Linux side  as key sym/ key codes, maybe do some translation, and 
ta-da,  I  now can dictate from the Windows virtual machine into Linux.

I now have, within reach, a fair amount of accessibility added by simple 
open-loop keystroke macros. The RPC mechanism tied into the Python 
extension to NaturallySpeaking, it's possible to execute even more 
sophisticated speech user interfaces.

thank you so much for the help.  future trick will be synchronizing 
tkinter window on windows with one on linux

--- eric



More information about the Python-list mailing list