mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
bootmanager: Allow mouse clicks only if touch is disabled
Previously mouse clicks will not register when touch is disabled. This rectifies that and allows mouse clicks to be mapped to other buttons if the touchscreen is disabled.
This commit is contained in:
parent
57d89e291d
commit
484623cd61
1 changed files with 13 additions and 3 deletions
|
@ -382,7 +382,12 @@ void GRenderWindow::keyReleaseEvent(QKeyEvent* event) {
|
|||
}
|
||||
|
||||
void GRenderWindow::mousePressEvent(QMouseEvent* event) {
|
||||
// touch input is handled in TouchBeginEvent
|
||||
if (!Settings::values.touchscreen.enabled) {
|
||||
input_subsystem->GetKeyboard()->PressKey(event->button());
|
||||
return;
|
||||
}
|
||||
|
||||
// Touch input is handled in TouchBeginEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
}
|
||||
|
@ -398,7 +403,7 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
|
|||
}
|
||||
|
||||
void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
|
||||
// touch input is handled in TouchUpdateEvent
|
||||
// Touch input is handled in TouchUpdateEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
}
|
||||
|
@ -411,7 +416,12 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
|
|||
}
|
||||
|
||||
void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
|
||||
// touch input is handled in TouchEndEvent
|
||||
if (!Settings::values.touchscreen.enabled) {
|
||||
input_subsystem->GetKeyboard()->ReleaseKey(event->button());
|
||||
return;
|
||||
}
|
||||
|
||||
// Touch input is handled in TouchEndEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue