[Spice-devel] [PATCH] Handle scancode extensions E1 and E2
Pavel Grunt
pgrunt at redhat.com
Mon Aug 1 12:50:16 UTC 2016
On Mon, 2016-08-01 at 13:27 +0100, Frediano Ziglio wrote:
> Do not handle them as normal keys.
> State is not saved for these keys.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
> server/inputs-channel.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/server/inputs-channel.c b/server/inputs-channel.c
> index 8f0a206..69d0391 100644
> --- a/server/inputs-channel.c
> +++ b/server/inputs-channel.c
> @@ -57,7 +57,7 @@
> (4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) *
> SPICE_AGENT_MAX_DATA_SIZE)
>
> struct SpiceKbdState {
> - bool push_ext;
> + uint8_t push_ext_type;
>
> /* track key press state */
> bool key[0x80];
> @@ -200,12 +200,14 @@ static void kbd_push_scan(SpiceKbdInstance *sin, uint8_t
> scan)
> sif = SPICE_CONTAINEROF(sin->base.sif, SpiceKbdInterface, base);
>
> /* track XT scan code set 1 key state */
> - if (scan == 0xe0) {
> - sin->st->push_ext = TRUE;
> + if (scan >= 0xe0 && scan <= 0xe2) {
> + sin->st->push_ext_type = scan;
> } else {
> - bool *state = sin->st->push_ext ? sin->st->key : sin->st->key_ext;
> - sin->st->push_ext = FALSE;
> - state[scan & 0x7f] = !(scan & 0x80);
> + if (sin->st->push_ext_type == 0 || sin->st->push_ext_type == 0xe0) {
> + bool *state = sin->st->push_ext_type ? sin->st->key_ext : sin-
> >st->key;
> + state[scan & 0x7f] = !(scan & 0x80);
> + }
> + sin->st->push_ext_type = 0;
> }
>
> sif->push_scan_freg(sin, scan);
More information about the Spice-devel
mailing list