In the virtual keyboard example, simulate not only key press but also release

This commit is contained in:
Simon Hausmann 2023-04-14 09:13:16 +02:00 committed by Simon Hausmann
parent 4d502a9f96
commit f57bab3650
2 changed files with 8 additions and 3 deletions

View file

@ -5,8 +5,10 @@
void init_virtual_keyboard(slint::ComponentHandle<MainWindow> app)
{
app->global<VirtualKeyboardHandler>().on_key_pressed(
[=](auto key) { app->window().dispatch_key_press_event(key); });
app->global<VirtualKeyboardHandler>().on_key_pressed([=](auto key) {
app->window().dispatch_key_press_event(key);
app->window().dispatch_key_release_event(key);
});
}
int main()