mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-16 08:15:53 +00:00
@@ -158,18 +158,10 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
|
||||
};
|
||||
}
|
||||
}
|
||||
has_moved = true;
|
||||
}
|
||||
|
||||
void Mouse::NotifyChanged() {
|
||||
auto const timestamp = Common::SteadyClock::Now();
|
||||
if (button_pressed || has_moved) {
|
||||
has_moved = false;
|
||||
} else {
|
||||
// neutral due to no movement or press
|
||||
last_mouse_change = {0.f, 0.f};
|
||||
last_motion_change = {0.f, 0.f, 0.f};
|
||||
}
|
||||
UpdateStickInput(timestamp);
|
||||
UpdateMotionInput(timestamp);
|
||||
last_notify_timestamp = timestamp;
|
||||
@@ -178,13 +170,11 @@ void Mouse::NotifyChanged() {
|
||||
void Mouse::MouseMove(f32 touch_x, f32 touch_y) {
|
||||
SetAxis(real_mouse_identifier, mouse_axis_x, touch_x);
|
||||
SetAxis(real_mouse_identifier, mouse_axis_y, touch_y);
|
||||
has_moved = true;
|
||||
}
|
||||
|
||||
void Mouse::TouchMove(f32 touch_x, f32 touch_y) {
|
||||
SetAxis(touch_identifier, mouse_axis_x, touch_x);
|
||||
SetAxis(touch_identifier, mouse_axis_y, touch_y);
|
||||
has_moved = true;
|
||||
}
|
||||
|
||||
void Mouse::PressButton(int x, int y, MouseButton button) {
|
||||
|
||||
@@ -492,7 +492,6 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
|
||||
input_subsystem->GetMouse()->PressMouseButton(button);
|
||||
input_subsystem->GetMouse()->PressButton(pos.x(), pos.y(), button);
|
||||
input_subsystem->GetMouse()->PressTouchButton(touch_x, touch_y, button);
|
||||
input_subsystem->GetMouse()->NotifyChanged();
|
||||
|
||||
emit MouseActivity();
|
||||
}
|
||||
@@ -513,7 +512,6 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
|
||||
input_subsystem->GetMouse()->MouseMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->TouchMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->Move(pos.x(), pos.y(), center_x, center_y);
|
||||
input_subsystem->GetMouse()->NotifyChanged();
|
||||
|
||||
// Center mouse for mouse panning
|
||||
if (Settings::values.mouse_panning && !Settings::values.mouse_enabled) {
|
||||
@@ -538,7 +536,6 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
|
||||
|
||||
const auto button = QtButtonToMouseButton(event->button());
|
||||
input_subsystem->GetMouse()->ReleaseButton(button);
|
||||
input_subsystem->GetMouse()->NotifyChanged();
|
||||
}
|
||||
|
||||
void GRenderWindow::ConstrainMouse() {
|
||||
@@ -567,7 +564,6 @@ void GRenderWindow::wheelEvent(QWheelEvent* event) {
|
||||
const int x = event->angleDelta().x();
|
||||
const int y = event->angleDelta().y();
|
||||
input_subsystem->GetMouse()->MouseWheelChange(x, y);
|
||||
input_subsystem->GetMouse()->NotifyChanged();
|
||||
}
|
||||
|
||||
void GRenderWindow::TouchBeginEvent(const QTouchEvent* event) {
|
||||
@@ -716,7 +712,6 @@ void GRenderWindow::focusOutEvent(QFocusEvent* event) {
|
||||
input_subsystem->GetKeyboard()->ReleaseAllKeys();
|
||||
input_subsystem->GetTouchScreen()->ReleaseAllTouch();
|
||||
input_subsystem->GetMouse()->ReleaseAllButtons();
|
||||
input_subsystem->GetMouse()->NotifyChanged();
|
||||
}
|
||||
|
||||
void GRenderWindow::resizeEvent(QResizeEvent* event) {
|
||||
|
||||
Reference in New Issue
Block a user