mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
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 <xakepa10@gmail.com>
This commit is contained in:
parent
76537cfbf6
commit
be70ca9e8c
1 changed files with 1 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue