[PyQt] Programmatically changing the input method, and a missing qinputcontextfactory

Damien Elmes resolve at ichi2.net
Tue Mar 10 22:27:18 GMT 2009


Testing this out, QInputContextFactory.keys() returns 6 instances of
"win", and there doesn't seem to be an obvious way to access the
Japanese IME. I'm starting to think this might not be possible without
writing a custom plugin that uses raw win32 calls to do its magic,
unfortunately.

On Wed, Jan 28, 2009 at 2:48 AM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On Sat, 24 Jan 2009 17:25:18 +0900, Damien Elmes <resolve at ichi2.net> wrote:
>> Hi folks,
>>
>> In my application (http://ichi2.net/anki/) I'd like text input fields
>> to remember the last input method, so that if a user is inputting
>> Japanese into one field and English in another, they don't have to
>> switch between input methods every time. This works out of the box for
>> me on Linux, as apparently Qt uses a separate XIM context for each
>> widget. But on Windows and OSX, the input context seems to be
>> application-wide.
>>
>> I was looking at the docs to QInputContextFactory. The keys() and
>> languages() methods look like they might be useful here, but I see
>> that this class is not available in PyQt. Am I barking up the wrong
>> tree? If inclusion of this class in unlikely in the future, is there
>> an easy way to add it to a binary install of PyQt (such as dropping an
>> extra sip into a directory)?
>
> QInputContextFactory will be in tonight's PyQt4 snapshot - I'm not sure why
> I didn't wrap it originally.
>
> Phil
>


More information about the PyQt mailing list