mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Change default mouse wheel behavior (ctrl+wheel = change brush size)
This commit is contained in:
parent
f4db850fb4
commit
f47508c21a
@ -62,8 +62,10 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
|
||||
// precise wheel i.e. a trackpad/touch-like device, we scroll by
|
||||
// default.
|
||||
else if (Preferences::instance().editor.zoomWithWheel() && !msg->preciseWheel()) {
|
||||
if (msg->ctrlPressed())
|
||||
if (msg->ctrlPressed() && msg->shiftPressed())
|
||||
wheelAction = WheelAction::Frame;
|
||||
else if (msg->ctrlPressed())
|
||||
wheelAction = WheelAction::BrushSize;
|
||||
else if (delta.x != 0 || msg->shiftPressed())
|
||||
wheelAction = WheelAction::HScroll;
|
||||
else
|
||||
@ -71,8 +73,10 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
|
||||
}
|
||||
// Zoom sliding two fingers
|
||||
else if (Preferences::instance().editor.zoomWithSlide() && msg->preciseWheel()) {
|
||||
if (msg->ctrlPressed())
|
||||
if (msg->ctrlPressed() && msg->shiftPressed())
|
||||
wheelAction = WheelAction::Frame;
|
||||
else if (msg->ctrlPressed())
|
||||
wheelAction = WheelAction::BrushSize;
|
||||
else if (std::abs(delta.x) > std::abs(delta.y)) {
|
||||
delta.y = 0;
|
||||
dz = delta.x;
|
||||
|
@ -931,10 +931,15 @@ void KeyboardShortcuts::setDefaultMouseWheelKeys(const bool zoomWithWheel)
|
||||
m_keys.push_back(key);
|
||||
|
||||
if (zoomWithWheel) {
|
||||
key = std::make_shared<Key>(WheelAction::Frame);
|
||||
key = std::make_shared<Key>(WheelAction::BrushSize);
|
||||
key->add(Accelerator(kKeyCtrlModifier, kKeyNil, 0),
|
||||
KeySource::Original, *this);
|
||||
m_keys.push_back(key);
|
||||
|
||||
key = std::make_shared<Key>(WheelAction::Frame);
|
||||
key->add(Accelerator((KeyModifiers)(kKeyCtrlModifier | kKeyShiftModifier), kKeyNil, 0),
|
||||
KeySource::Original, *this);
|
||||
m_keys.push_back(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user