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:
Cristian Adam
2023-06-30 13:44:44 +02:00
parent 5b93ecdd05
commit c529a87240

View File

@@ -1,6 +1,8 @@
// 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
#include <utils/hostosinfo.h>
#include "keys.h"
namespace Terminal::Internal {
@@ -72,8 +74,14 @@ VTermKey qtKeyToVTerm(Qt::Key key, bool keypad)
return keypad ? VTERM_KEY_KP_PERIOD : VTERM_KEY_NONE;
case Qt::Key_Slash:
return keypad ? VTERM_KEY_KP_DIVIDE : VTERM_KEY_NONE;
case Qt::Key_Enter:
return keypad ? VTERM_KEY_KP_ENTER : VTERM_KEY_NONE;
case Qt::Key_Enter: {
VTermKey enterKey = VTERM_KEY_KP_ENTER;
if (Utils::HostOsInfo::isWindowsHost())
enterKey = VTERM_KEY_ENTER;
return keypad ? enterKey : VTERM_KEY_NONE;
}
case Qt::Key_Equal:
return keypad ? VTERM_KEY_KP_EQUAL : VTERM_KEY_NONE;
default: