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

Re: [pygame] virtual keyboard input problems under windows



On 02/04/2010 01:22 PM, Marcus von Appen wrote:
      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?

    Thanks for the quick response!

    Application is "EmoKey" more information here:

http://www.emotiv.com/apps/epoc/299/


I don't know anything about its internals, but from searching their forums, one of their staff has stated that the application "inserts the characters into the keyboard input stream."

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
            ....


I ended up writing a debug mode which would print the contents of any and every pygame.event detected. Nothing was printed out at all (as opposed to say, swiping the mouse pointer across the pygame application window).


      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.

Odd, it sounds the software providers are saying should be working then.

      ...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.

My mistake, I thought I read somewhere that things like SDL 1.3 and Python 3 were targets for pygame 2 (aka pygame reloaded).


Cheers

Steve