[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] virtual keyboard input problems under windows



On, Thu Feb 04, 2010, Steve Castellotti wrote:

> Hi all-
> 
>      I've written a simple pygame application which is meant to receive 
> keystrokes from a third-party closed-source "virtual keyboard" program 
> running under Windows.

Which is it and is there some demo/test version available? Are there any
specs available about how it perfomrs the virtual input?
 
>      I can successfully receive keystrokes by using the physical 
> keyboard and even through Microsoft's own "On Screen Keyboard" which is 
> distributed with the OS for accessibility purposes.
> 
>      However I am unfortunately having no luck receiving keystrokes from 
> this particular application (and that is the only means to interface 
> with its output programmatically). I have at least confirmed the 
> third-party application works with with other Windows applications such 
> as Notepad.
> 
> 
>      Can anyone recommend avenues to pursue in debugging this problem?

Did you try to get the SYSWMEVENT and checked, whether it occured on
performing some input with the virtual keyboard? Maybe the virtual
keyboard uses a different Win32 event type with extra payload describing
the key:

    events = pygame.event.get ()
    for event in events:
        if event.type == pygame.SYSWMEVENT:
           print event
           ....

> 
>      Is pygame (SDL) somehow talking directly to the keyboard device 
> driver, so no pygame.event objects are getting created?

It talks directly to the Win32 application/window message queue and gets
its events from there, so anything arriving in the message queue will
find its way into the SDL (and thus) pygame event handling queue, usually.
 
> 
>      I've noticed elsewhere some details about SDL 1.3 having a 
> rewritten, or at least different input model:
> 
> http://www.mail-archive.com/adonthell-devel@xxxxxxxxxx/msg00576.html
> 
> 
>      ...would it make sense to try compiling the latest SVN of SDL 1.3 
> under Windows and building Pygame Reloaded against that?

Are we talking about pygame or pygame reloaded? Both have a different
kind of API (though the event handling does not differ much).

Besides that, neither pygame nor pygame reloaded support SDL 1.3.

Regards
Marcus

Attachment: pgp0pozuduX9c.pgp
Description: PGP signature