mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:25:08 +00:00
LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking a button.
This commit is contained in:
parent
3a905aed06
commit
977863ea07
37 changed files with 76 additions and 76 deletions
|
@ -134,7 +134,7 @@ void AbstractButton::mouseup_event(MouseEvent& event)
|
|||
m_being_pressed = false;
|
||||
update();
|
||||
if (was_being_pressed && !was_auto_repeating)
|
||||
click();
|
||||
click(event.modifiers());
|
||||
}
|
||||
Widget::mouseup_event(event);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ void AbstractButton::leave_event(Core::Event&)
|
|||
void AbstractButton::keydown_event(KeyEvent& event)
|
||||
{
|
||||
if (event.key() == KeyCode::Key_Return) {
|
||||
click();
|
||||
click(event.modifiers());
|
||||
event.accept();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue