Finish rulers by pressing the Enter key

This commit is contained in:
Matthias Koefferlein 2026-01-24 14:29:11 +01:00
parent ccd9952d49
commit de70025316
2 changed files with 16 additions and 1 deletions

View File

@ -1878,9 +1878,23 @@ Service::mouse_double_click_event (const db::DPoint & /*p*/, unsigned int button
finish_drawing ();
return true;
} else {
return false;
}
}
return false;
bool
Service::key_event (unsigned int key, unsigned int buttons)
{
if (m_drawing && buttons == 0 && (key == lay::KeyEnter || key == lay::KeyReturn)) {
// ends the current ruler (specifically in multi-segment mode)
finish_drawing ();
return true;
} else {
return false;
}
}
lay::TwoPointSnapToObjectResult

View File

@ -644,6 +644,7 @@ private:
virtual bool mouse_press_event (const db::DPoint &p, unsigned int buttons, bool prio);
virtual bool mouse_click_event (const db::DPoint &p, unsigned int buttons, bool prio);
virtual bool mouse_double_click_event (const db::DPoint &p, unsigned int buttons, bool prio);
virtual bool key_event (unsigned int key, unsigned int buttons);
virtual void deactivated ();
void snap_rulers (lay::angle_constraint_type ac);