From be70ca9e8c6d937b0afc3a2d6d176c5c0d0cb768 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 14 May 2024 02:30:14 +0300 Subject: [PATCH] kdeui: use KKeyServer::keyQtToCodeX() for the key to keycode conversion in kGrabKey() libhotkeys was using it and it does some tricks such as adding shift mod for captical letters Signed-off-by: Ivailo Monev --- kdeui/shortcuts/kglobalaccel.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/kdeui/shortcuts/kglobalaccel.cpp b/kdeui/shortcuts/kglobalaccel.cpp index 1ae650a5..eed733a5 100644 --- a/kdeui/shortcuts/kglobalaccel.cpp +++ b/kdeui/shortcuts/kglobalaccel.cpp @@ -74,18 +74,11 @@ static bool kGrabKey(const int keyQt, uint &keyModX, int &keyCodeX) return false; } - uint keySymX = 0; if (!KKeyServer::keyQtToModX(keyQt, &keyModX)) { kWarning(s_kglobalaccelarea) << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") failed to resolve to x11 modifier"; return false; } - if (!KKeyServer::keyQtToSymX(keyQt, (int *)&keySymX) ) { - kWarning(s_kglobalaccelarea) << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") failed to resolve to x11 keycode"; - return false; - } - - keyCodeX = XKeysymToKeycode(display, keySymX); - if (!keyCodeX) { + if (!KKeyServer::keyQtToCodeX(keyQt, &keyCodeX)) { kWarning(s_kglobalaccelarea) << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") was resolved to x11 keycode 0"; return false; }