Skip to content

Commit

Permalink
Synthesize click events (down, 100ms, up) on key release.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarek-y-ismail committed Feb 21, 2025
1 parent daade8b commit a954c49
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/server/shell/mouse_keys_transformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,18 @@ bool mir::input::MouseKeysTransformer::handle_click(
case XKB_KEY_KP_5:
switch (action)
{
case mir_keyboard_action_down:
press_current_cursor_button(dispatcher);
return true;
case mir_keyboard_action_up:
release_current_cursor_button(dispatcher);
press_current_cursor_button(dispatcher);

click_event_generator = main_loop->create_alarm(
[dispatcher, this]
{
release_current_cursor_button(dispatcher);
});

click_event_generator->reschedule_in(std::chrono::milliseconds(50));
return true;
case mir_keyboard_action_down:
case mir_keyboard_action_repeat:
return true;
default:
Expand Down

0 comments on commit a954c49

Please sign in to comment.