}
vnc_remove_timer(vs->vd);
- qemu_remove_led_event_handler(vs->led);
+ if (vs->vd->lock_key_sync)
+ qemu_remove_led_event_handler(vs->led);
qemu_free(vs);
}
break;
}
- if (keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
+ if (vs->vd->lock_key_sync &&
+ keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
/* If the numlock state needs to change then simulate an additional
keypress before sending this one. This will happen if the user
toggles numlock away from the VNC window.
}
}
- if ((sym >= 'A' && sym <= 'Z') || (sym >= 'a' && sym <= 'z')) {
+ if (vs->vd->lock_key_sync &&
+ ((sym >= 'A' && sym <= 'Z') || (sym >= 'a' && sym <= 'z'))) {
/* If the capslock state needs to change then simulate an additional
keypress before sending this one. This will happen if the user
toggles capslock away from the VNC window.
vnc_flush(vs);
vnc_read_when(vs, protocol_version, 12);
reset_keys(vs);
- vs->led = qemu_add_led_event_handler(kbd_leds, vs);
+ if (vs->vd->lock_key_sync)
+ vs->led = qemu_add_led_event_handler(kbd_leds, vs);
vnc_init_timer(vd);
int saslErr;
#endif
int acl = 0;
+ int lock_key_sync = 1;
if (!vnc_display)
return -1;
password = 1; /* Require password auth */
} else if (strncmp(options, "reverse", 7) == 0) {
reverse = 1;
+ } else if (strncmp(options, "no-lock-key-sync", 9) == 0) {
+ lock_key_sync = 0;
#ifdef CONFIG_VNC_SASL
} else if (strncmp(options, "sasl", 4) == 0) {
sasl = 1; /* Require SASL auth */
return -1;
}
#endif
+ vs->lock_key_sync = lock_key_sync;
if (reverse) {
/* connect to viewer */