mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 11:35:56 +00:00
fix: switch on mouse key
1. 过滤掉开关键的非MouseButtonPress类型的事件的处理
This commit is contained in:
parent
7c29c2b3c6
commit
b39848e79f
1 changed files with 9 additions and 8 deletions
|
@ -49,10 +49,10 @@ InputConvertGame::~InputConvertGame()
|
|||
void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize)
|
||||
{
|
||||
// 处理开关按键
|
||||
if (m_keyMap.isSwitchOnKeyboard() == false &&
|
||||
from->type() == QEvent::MouseButtonPress &&
|
||||
m_keyMap.getSwitchKey() == from->button())
|
||||
{
|
||||
if (m_keyMap.isSwitchOnKeyboard() == false && m_keyMap.getSwitchKey() == from->button()) {
|
||||
if (from->type() != QEvent::MouseButtonPress) {
|
||||
return;
|
||||
}
|
||||
if (!switchGameMap()) {
|
||||
m_needSwitchGameAgain = false;
|
||||
}
|
||||
|
@ -89,10 +89,11 @@ void InputConvertGame::keyEvent(const QKeyEvent *from, const QSize& frameSize, c
|
|||
{
|
||||
// 处理开关按键
|
||||
if (m_keyMap.isSwitchOnKeyboard() && m_keyMap.getSwitchKey() == from->key()) {
|
||||
if (QEvent::KeyPress == from->type()) {
|
||||
if (!switchGameMap()) {
|
||||
m_needSwitchGameAgain = false;
|
||||
}
|
||||
if (QEvent::KeyPress != from->type()) {
|
||||
return;
|
||||
}
|
||||
if (!switchGameMap()) {
|
||||
m_needSwitchGameAgain = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue