server: Add rawinput union to hw_input_t / INPUT_HARDWARE.

When msg is WM_INPUT_DEVICE_CHANGE.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-06 12:57:31 +02:00 committed by Alexandre Julliard
parent c0fc89991b
commit 6d167b91ad
3 changed files with 66 additions and 37 deletions

View File

@ -262,30 +262,32 @@ struct hw_msg_source
unsigned int origin;
};
union rawinput
{
int type;
struct
{
int type;
unsigned int message;
unsigned short vkey;
unsigned short scan;
} kbd;
struct
{
int type;
int x;
int y;
unsigned int data;
} mouse;
};
struct hardware_msg_data
{
lparam_t info;
unsigned int hw_id;
unsigned int flags;
struct hw_msg_source source;
union
{
int type;
struct
{
int type;
unsigned int message;
unsigned short vkey;
unsigned short scan;
} kbd;
struct
{
int type;
int x;
int y;
unsigned int data;
} mouse;
} rawinput;
union rawinput rawinput;
};
struct callback_msg_data
@ -330,6 +332,7 @@ typedef union
int type;
unsigned int msg;
lparam_t lparam;
union rawinput rawinput;
} hw;
} hw_input_t;
@ -6233,7 +6236,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 698
#define SERVER_PROTOCOL_VERSION 699
/* ### protocol_version end ### */

View File

@ -278,30 +278,32 @@ struct hw_msg_source
unsigned int origin; /* source origin (IMO_* values) */
};
union rawinput
{
int type;
struct
{
int type; /* RIM_TYPEKEYBOARD */
unsigned int message; /* message generated by this rawinput event */
unsigned short vkey; /* virtual key code */
unsigned short scan; /* scan code */
} kbd;
struct
{
int type; /* RIM_TYPEMOUSE */
int x; /* x coordinate */
int y; /* y coordinate */
unsigned int data; /* mouse data */
} mouse;
};
struct hardware_msg_data
{
lparam_t info; /* extra info */
unsigned int hw_id; /* unique id */
unsigned int flags; /* hook flags */
struct hw_msg_source source; /* message source */
union
{
int type;
struct
{
int type; /* RIM_TYPEKEYBOARD */
unsigned int message; /* message generated by this rawinput event */
unsigned short vkey; /* virtual key code */
unsigned short scan; /* scan code */
} kbd;
struct
{
int type; /* RIM_TYPEMOUSE */
int x; /* x coordinate */
int y; /* y coordinate */
unsigned int data; /* mouse data */
} mouse;
} rawinput;
union rawinput rawinput; /* rawinput message data */
};
struct callback_msg_data
@ -346,6 +348,7 @@ typedef union
int type; /* INPUT_HARDWARE */
unsigned int msg; /* message code */
lparam_t lparam; /* message param */
union rawinput rawinput;/* rawinput message data */
} hw;
} hw_input_t;

View File

@ -395,6 +395,24 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data )
}
}
static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
{
switch (rawinput->type)
{
case RIM_TYPEMOUSE:
fprintf( stderr, "%s{type=MOUSE,x=%d,y=%d,data=%08x}", prefix, rawinput->mouse.x,
rawinput->mouse.y, rawinput->mouse.data );
break;
case RIM_TYPEKEYBOARD:
fprintf( stderr, "%s{type=KEYBOARD,message=%04x,vkey=%04hx,scan=%04hx}", prefix,
rawinput->kbd.message, rawinput->kbd.vkey, rawinput->kbd.scan );
break;
default:
fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type );
break;
}
}
static void dump_hw_input( const char *prefix, const hw_input_t *input )
{
switch (input->type)
@ -415,6 +433,11 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
case INPUT_HARDWARE:
fprintf( stderr, "%s{type=HARDWARE,msg=%04x", prefix, input->hw.msg );
dump_uint64( ",lparam=", &input->hw.lparam );
switch (input->hw.msg)
{
case WM_INPUT_DEVICE_CHANGE:
dump_rawinput( ",rawinput=", &input->hw.rawinput );
}
fputc( '}', stderr );
break;
default: