|
|
|
@ -15,6 +15,7 @@ InputConvertGame::~InputConvertGame()
|
|
|
|
|
|
|
|
|
|
|
|
void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize)
|
|
|
|
void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_gameMap) {
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
|
|
|
|
|
|
|
|
// mouse move
|
|
|
|
// mouse move
|
|
|
|
@ -26,17 +27,31 @@ void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSiz
|
|
|
|
if (processMouseClick(from)) {
|
|
|
|
if (processMouseClick(from)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
InputConvertNormal::mouseEvent(from, frameSize, showSize);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InputConvertGame::wheelEvent(const QWheelEvent *from, const QSize &frameSize, const QSize &showSize)
|
|
|
|
void InputConvertGame::wheelEvent(const QWheelEvent *from, const QSize &frameSize, const QSize &showSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Q_UNUSED(from);
|
|
|
|
if (m_gameMap) {
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
InputConvertNormal::wheelEvent(from, frameSize, showSize);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InputConvertGame::keyEvent(const QKeyEvent *from, const QSize& frameSize, const QSize& showSize)
|
|
|
|
void InputConvertGame::keyEvent(const QKeyEvent *from, const QSize& frameSize, const QSize& showSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
switch (from->key()) {
|
|
|
|
|
|
|
|
case Qt::Key_QuoteLeft:
|
|
|
|
|
|
|
|
if (QEvent::KeyPress == from->type()) {
|
|
|
|
|
|
|
|
m_gameMap = !m_gameMap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_gameMap) {
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
updateSize(frameSize, showSize);
|
|
|
|
if (!from || from->isAutoRepeat()) {
|
|
|
|
if (!from || from->isAutoRepeat()) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -52,6 +67,9 @@ void InputConvertGame::keyEvent(const QKeyEvent *from, const QSize& frameSize, c
|
|
|
|
if (processKeyClick(from)) {
|
|
|
|
if (processKeyClick(from)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
InputConvertNormal::keyEvent(from, frameSize, showSize);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InputConvertGame::updateSize(const QSize &frameSize, const QSize &showSize)
|
|
|
|
void InputConvertGame::updateSize(const QSize &frameSize, const QSize &showSize)
|
|
|
|
|