> > @@ -1859,30 +1828,25 @@ static void do_key_event(VncState *vs, int down, > > int keycode, int sym) > > toggles capslock away from the VNC window. > > */ > > int uppercase = !!(sym >= 'A' && sym <= 'Z'); > > - int shift = !!(vs->modifiers_state[0x2a] | > > vs->modifiers_state[0x36]); > > - int capslock = !!(vs->modifiers_state[0x3a]); > > + bool shift = kbd_state_modifier_get(vs->vd->kbd, KBD_MOD_SHIFT); > > + bool capslock = kbd_state_modifier_get(vs->vd->kbd, > > KBD_MOD_CAPSLOCK); > > This uses the modifier state > > In old code it would use the newly updated modifier state > > In new code it now uses the old modifier state.
Ordering doesn't matter. This code doesn't run on modifier key events. On letter keydown events it checks whenever shift and capslock state are consistent, and if not it generates a capslock keypress. cheers, Gerd