mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 05:14:46 +00:00
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:
parent
c0fc89991b
commit
6d167b91ad
|
@ -262,30 +262,32 @@ struct hw_msg_source
|
||||||
unsigned int origin;
|
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
|
struct hardware_msg_data
|
||||||
{
|
{
|
||||||
lparam_t info;
|
lparam_t info;
|
||||||
unsigned int hw_id;
|
unsigned int hw_id;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
struct hw_msg_source source;
|
struct hw_msg_source source;
|
||||||
union
|
union rawinput 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;
|
|
||||||
} rawinput;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct callback_msg_data
|
struct callback_msg_data
|
||||||
|
@ -330,6 +332,7 @@ typedef union
|
||||||
int type;
|
int type;
|
||||||
unsigned int msg;
|
unsigned int msg;
|
||||||
lparam_t lparam;
|
lparam_t lparam;
|
||||||
|
union rawinput rawinput;
|
||||||
} hw;
|
} hw;
|
||||||
} hw_input_t;
|
} hw_input_t;
|
||||||
|
|
||||||
|
@ -6233,7 +6236,7 @@ union generic_reply
|
||||||
|
|
||||||
/* ### protocol_version begin ### */
|
/* ### protocol_version begin ### */
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 698
|
#define SERVER_PROTOCOL_VERSION 699
|
||||||
|
|
||||||
/* ### protocol_version end ### */
|
/* ### protocol_version end ### */
|
||||||
|
|
||||||
|
|
|
@ -278,30 +278,32 @@ struct hw_msg_source
|
||||||
unsigned int origin; /* source origin (IMO_* values) */
|
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
|
struct hardware_msg_data
|
||||||
{
|
{
|
||||||
lparam_t info; /* extra info */
|
lparam_t info; /* extra info */
|
||||||
unsigned int hw_id; /* unique id */
|
unsigned int hw_id; /* unique id */
|
||||||
unsigned int flags; /* hook flags */
|
unsigned int flags; /* hook flags */
|
||||||
struct hw_msg_source source; /* message source */
|
struct hw_msg_source source; /* message source */
|
||||||
union
|
union rawinput rawinput; /* rawinput message data */
|
||||||
{
|
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct callback_msg_data
|
struct callback_msg_data
|
||||||
|
@ -346,6 +348,7 @@ typedef union
|
||||||
int type; /* INPUT_HARDWARE */
|
int type; /* INPUT_HARDWARE */
|
||||||
unsigned int msg; /* message code */
|
unsigned int msg; /* message code */
|
||||||
lparam_t lparam; /* message param */
|
lparam_t lparam; /* message param */
|
||||||
|
union rawinput rawinput;/* rawinput message data */
|
||||||
} hw;
|
} hw;
|
||||||
} hw_input_t;
|
} hw_input_t;
|
||||||
|
|
||||||
|
|
|
@ -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 )
|
static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||||
{
|
{
|
||||||
switch (input->type)
|
switch (input->type)
|
||||||
|
@ -415,6 +433,11 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||||
case INPUT_HARDWARE:
|
case INPUT_HARDWARE:
|
||||||
fprintf( stderr, "%s{type=HARDWARE,msg=%04x", prefix, input->hw.msg );
|
fprintf( stderr, "%s{type=HARDWARE,msg=%04x", prefix, input->hw.msg );
|
||||||
dump_uint64( ",lparam=", &input->hw.lparam );
|
dump_uint64( ",lparam=", &input->hw.lparam );
|
||||||
|
switch (input->hw.msg)
|
||||||
|
{
|
||||||
|
case WM_INPUT_DEVICE_CHANGE:
|
||||||
|
dump_rawinput( ",rawinput=", &input->hw.rawinput );
|
||||||
|
}
|
||||||
fputc( '}', stderr );
|
fputc( '}', stderr );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue