mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
basic keyboard: release all keys on FocusOut event
This commit is contained in:
parent
67e2e154fa
commit
5416f60643
3 changed files with 33 additions and 6 deletions
|
|
@ -62,13 +62,27 @@ bool basic_keyboard_handler::eventFilter(QObject* watched, QEvent* event)
|
|||
// !m_target->isVisible() is a hack since currently a guiless application will STILL inititialize a gsrender (providing a valid target)
|
||||
if (!m_target || !m_target->isVisible() || watched == m_target)
|
||||
{
|
||||
if (event->type() == QEvent::KeyPress)
|
||||
switch (event->type())
|
||||
{
|
||||
case QEvent::KeyPress:
|
||||
{
|
||||
keyPressEvent(static_cast<QKeyEvent*>(event));
|
||||
break;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyRelease)
|
||||
case QEvent::KeyRelease:
|
||||
{
|
||||
keyReleaseEvent(static_cast<QKeyEvent*>(event));
|
||||
break;
|
||||
}
|
||||
case QEvent::FocusOut:
|
||||
{
|
||||
ReleaseAllKeys();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue