mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 20:37:34 +00:00
GUI: Give MouseEvent shift() / ctrl() / alt() / logo() functions
This commit is contained in:
parent
eab7712ab0
commit
cb2d56b909
2 changed files with 5 additions and 1 deletions
|
@ -331,6 +331,10 @@ public:
|
||||||
int y() const { return m_position.y(); }
|
int y() const { return m_position.y(); }
|
||||||
MouseButton button() const { return m_button; }
|
MouseButton button() const { return m_button; }
|
||||||
unsigned buttons() const { return m_buttons; }
|
unsigned buttons() const { return m_buttons; }
|
||||||
|
bool ctrl() const { return m_modifiers & Mod_Ctrl; }
|
||||||
|
bool alt() const { return m_modifiers & Mod_Alt; }
|
||||||
|
bool shift() const { return m_modifiers & Mod_Shift; }
|
||||||
|
bool logo() const { return m_modifiers & Mod_Logo; }
|
||||||
unsigned modifiers() const { return m_modifiers; }
|
unsigned modifiers() const { return m_modifiers; }
|
||||||
int wheel_delta() const { return m_wheel_delta; }
|
int wheel_delta() const { return m_wheel_delta; }
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ void ScrollableWidget::mousewheel_event(MouseEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// FIXME: The wheel delta multiplier should probably come from... somewhere?
|
// FIXME: The wheel delta multiplier should probably come from... somewhere?
|
||||||
if (event.modifiers() & Mod_Shift) {
|
if (event.shift()) {
|
||||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + event.wheel_delta() * 60);
|
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + event.wheel_delta() * 60);
|
||||||
} else {
|
} else {
|
||||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
|
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue