4

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.

3 Answers 3

4

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.

Sign up to request clarification or add additional context in comments.

Comments

3

Theres a nice looking library here http://code.google.com/p/pymultimouse/

It's not wx-python specific - but it does use raw input in python with ctypes (and worked in my test with 2 mice)

Comments

0

I've wrapped the win32 calls and put together a small Python package to hook into raw input events.

import winrawin
winrawin.hook_raw_input_for_window(hwid, process_event_fn)

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.