mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Qt6 port
This commit is contained in:
parent
9b3a878c18
commit
d119cf6e96
54 changed files with 431 additions and 595 deletions
|
|
@ -128,6 +128,7 @@ void basic_mouse_handler::MouseMove(QMouseEvent* event)
|
|||
{
|
||||
// get the screen dimensions
|
||||
const QSize screen = m_target->size();
|
||||
const QPoint e_pos = event->pos();
|
||||
|
||||
if (m_target && m_target->isActive() && get_mouse_lock_state())
|
||||
{
|
||||
|
|
@ -144,7 +145,7 @@ void basic_mouse_handler::MouseMove(QMouseEvent* event)
|
|||
static QPoint p_real(p_center);
|
||||
|
||||
// get the delta of the mouse position to the screen center
|
||||
const QPoint p_delta = event->pos() - p_center;
|
||||
const QPoint p_delta = e_pos - p_center;
|
||||
|
||||
// update the current position without leaving the screen borders
|
||||
p_real.setX(std::clamp(p_real.x() + p_delta.x(), 0, screen.width()));
|
||||
|
|
@ -155,7 +156,7 @@ void basic_mouse_handler::MouseMove(QMouseEvent* event)
|
|||
}
|
||||
else
|
||||
{
|
||||
MouseHandlerBase::Move(event->x(), event->y(), screen.width(), screen.height());
|
||||
MouseHandlerBase::Move(e_pos.x(), e_pos.y(), screen.width(), screen.height());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,12 +505,13 @@ void keyboard_pad_handler::mouseMoveEvent(QMouseEvent* event)
|
|||
{
|
||||
static int last_pos_x = 0;
|
||||
static int last_pos_y = 0;
|
||||
const QPoint e_pos = event->pos();
|
||||
|
||||
movement_x = event->x() - last_pos_x;
|
||||
movement_y = event->y() - last_pos_y;
|
||||
movement_x = e_pos.x() - last_pos_x;
|
||||
movement_y = e_pos.y() - last_pos_y;
|
||||
|
||||
last_pos_x = event->x();
|
||||
last_pos_y = event->y();
|
||||
last_pos_x = e_pos.x();
|
||||
last_pos_y = e_pos.y();
|
||||
}
|
||||
else if (m_target && m_target->isActive())
|
||||
{
|
||||
|
|
@ -807,8 +808,8 @@ u32 keyboard_pad_handler::GetKeyCode(const QString& keyName)
|
|||
const QKeySequence seq(keyName);
|
||||
u32 key_code = Qt::NoButton;
|
||||
|
||||
if (seq.count() == 1 && seq[0] != Qt::Key_unknown)
|
||||
key_code = seq[0];
|
||||
if (seq.count() == 1 && seq[0].key() != Qt::Key_unknown)
|
||||
key_code = seq[0].key();
|
||||
else
|
||||
input_log.notice("GetKeyCode(%s): seq.count() = %d", keyName, seq.count());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue