Able to open paint popup and move with the same button

This commit is contained in:
Yousef Khadadeh 2026-06-03 13:02:37 +03:00
parent ba34431be1
commit e35fd4fa79
2 changed files with 3 additions and 2 deletions

View file

@ -127,7 +127,7 @@ void DrawingProgram::input_mouse_button_callback(const InputManager::MouseButton
if(button.down) {
if(button.button == InputManager::MouseButton::RIGHT) {
if(!controls.middleClickHeld && !controls.leftClickHeld) {
if(!controls.leftClickHeld) {
if(rightClickPopupLocation.has_value())
clear_right_click_popup();
else

View file

@ -491,6 +491,7 @@ void InputManager::backend_pen_button_down_update(const SDL_PenButtonEvent& e) {
pen.buttons[e.button].held = true;
pen.isEraser = e.pen_state & SDL_PEN_INPUT_ERASER_TIP;
// Someone requested that one pen button be able to both middle click and right click at the same time, so don't turn this into an if-else statement
if(e.button == main.conf.tabletOptions.middleClickButton) {
main.input_mouse_button_callback({
.deviceType = MouseDeviceType::PEN,
@ -500,7 +501,7 @@ void InputManager::backend_pen_button_down_update(const SDL_PenButtonEvent& e) {
.pos = mouseNewPos
});
}
else if(e.button == main.conf.tabletOptions.rightClickButton) {
if(e.button == main.conf.tabletOptions.rightClickButton) {
main.input_mouse_button_callback({
.deviceType = MouseDeviceType::PEN,
.button = MouseButton::RIGHT,