[PATCH 01/10] user32/tests: Added client-side raw input function tests (try 12)

Vincas Miliūnas vincas.miliunas at gmail.com
Mon Jul 4 09:29:21 CDT 2011

* Added implementation and tests for RIDEV_NOLEGACY raw input device
flag. It's contained as a separate part, because it's invasive to
existing WINE's functionality.
* Added tests for other device flag precondition assertions and fixed
detected issues.
* Compiling with clang reported usage of an obsolete method of
initializing a structure field (e.g. {mouse: {...). Fixed it.
* Prioritized direct device registrations over whole page registrations,
when searching for one.
* In this release I decided to finally revert the usage of a circular
buffer data structure for input queue in favor of a list. I was good
suggestion and the only way to see it working was for me to implement
it. The main reason why a circular buffer is not fit for the task is
because it creates vacancies inside the queue, whereas a list does not
have this problem. This leads to a non-desired behavior, where the
middle of the buffer is filled with vacant entries and once a maximum
length is reached, the oldest valid entries (although already processed)
are forcibly dropped.

An illustration of the queue (of max length = 8) (each snapshot is taken
after adding a new entry), when input from a keyboard is followed by
input from a mouse:
Ka Kb Ma Mb
Ka Kb V Mb Mc
Ka Kb V V Mc Md
Ka Kb V V V Md Me
Ka Kb V V V V Me Mf
Kb V  V V V V Mf Mg
Mg Mh

The queue cannot be compacted, because the entries are referenced by ids
that are sent to the application.
A non-list data structure performing correctly would be using 2 arrays
to construct mapping from event id to event data pointer.

* Each simulation test now takes dedicated 0.5s to process messages
instead of the old way of quitting after a WM_INPUT or after a 2s timeout.
* Some other minor refactorings.

Previous changelog - http://source.winehq.org/patches/data/75950

Also a good idea is to share the app I'm using to log raw input events -

A comment about going beyond mouse/keyboard for raw input:
Other devices then mouse&keyboard produce undocumented blobs of bytes;
to interpret them, functions from the hid.dll are used. Currently they
are unimplemented stubs in WINE as well as not the problem I am solving.
There is a recent article about this subject - Using the Raw Input API
to Process Joystick Input -

 dlls/user32/tests/input.c |  994
 1 files changed, 994 insertions(+), 0 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-user32-tests-Added-client-side-raw-input-function-te.patch
Type: text/x-patch
Size: 44306 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110704/59c5fa31/attachment-0001.bin>

More information about the wine-patches mailing list