forked from qt-creator/qt-creator
Terminal: fix keypad Enter key handling on Windows
On Windows it looked like nothing happened when pressing the keypad's Enter key. By using the same handling as for the Return key, the terminal works as the user expects it. Fixes: QTCREATORBUG-29348 Change-Id: Ia49f0bb98aef8393f208671042d608a124cb431f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2022 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
|
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
|
||||||
namespace Terminal::Internal {
|
namespace Terminal::Internal {
|
||||||
@@ -72,8 +74,14 @@ VTermKey qtKeyToVTerm(Qt::Key key, bool keypad)
|
|||||||
return keypad ? VTERM_KEY_KP_PERIOD : VTERM_KEY_NONE;
|
return keypad ? VTERM_KEY_KP_PERIOD : VTERM_KEY_NONE;
|
||||||
case Qt::Key_Slash:
|
case Qt::Key_Slash:
|
||||||
return keypad ? VTERM_KEY_KP_DIVIDE : VTERM_KEY_NONE;
|
return keypad ? VTERM_KEY_KP_DIVIDE : VTERM_KEY_NONE;
|
||||||
case Qt::Key_Enter:
|
case Qt::Key_Enter: {
|
||||||
return keypad ? VTERM_KEY_KP_ENTER : VTERM_KEY_NONE;
|
VTermKey enterKey = VTERM_KEY_KP_ENTER;
|
||||||
|
|
||||||
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
|
enterKey = VTERM_KEY_ENTER;
|
||||||
|
|
||||||
|
return keypad ? enterKey : VTERM_KEY_NONE;
|
||||||
|
}
|
||||||
case Qt::Key_Equal:
|
case Qt::Key_Equal:
|
||||||
return keypad ? VTERM_KEY_KP_EQUAL : VTERM_KEY_NONE;
|
return keypad ? VTERM_KEY_KP_EQUAL : VTERM_KEY_NONE;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user