Search code examples
pythonwindowswxpythonraw-input

WX Python and Raw Input on Windows (WM_INPUT)


Does anyone know how to use the Raw Input facility on Windows from a WX Python application?

What I need to do is be able to differentiate the input from multiple keyboards. So if there is another way to achieving that, that would work too.


Solution

  • Have you tried using ctypes?

    >>> import ctypes
    >>> ctypes.windll.user32.RegisterRawInputDevices
    <_FuncPtr object at 0x01FCFDC8>
    

    It would be a little work setting up the Python version of the necessary structures, but you may be able to query the Win32 API directly this way without going through wxPython.