
Ich möchte einen externen Nummernblock als „Makrotastatur“ verwenden, wobei jede Taste eine bestimmte Aktion ausführen kann. Ich habe bereits eine benutzerdefinierte xkb_keymap
Zuordnung von Tasten zu XF86
Symbolen erstellt.
$ cat ~/.xinitrc
...
# Active macro keyboard
macrokb=$( xinput list | sed -n 's|.*MOSART.*2\.4G.*id=\([0-9]*\).*keyboard.*|\1|p' | head -n1 )
if [ "$macrokb" ]; then
cat ~/.xkb/macros.xkb | xkbcomp -i $macrokb - $DISPLAY
fi
$ cat ~/.xkb/macros.xkb
xkb_keymap "macros" {
xkb_keycodes {
// 0 - Chrome
<WEB> = 90;
// / - Windows
<WIN> = 106;
// * - Win attach
<ATCH> = 63;
// BS - Win detach
<DTCH> = 22;
// enter - Terminal
<TERM> = 104;
// numlock - Settings
<SETT> = 77;
};
xkb_types {
include "basic"
include "numpad"
};
xkb_compat { include "basic" };
xkb_symbols {
key.type = "ONE_LEVEL";
key <WEB> { [ XF86WWW ] };
key <WIN> { [ XF86Launch0 ] };
key <ATCH> { [ XF86Launch1 ] };
key <DTCH> { [ XF86Launch2 ] };
key <TERM> { [ XF86Terminal ] };
key <SETT> { [ XF86Tools ] };
};
};
Die benutzerdefinierte Tastaturbelegung wurde erfolgreich geladen und wird von erkannt xev
. Beispiel:
KeyPress event, serial 41, synthetic NO, window 0x5800001,
root 0x4f7, subw 0x0, time 5314499, (1656,414), root:(1656,443),
state 0x10, keycode 106 (keysym 0x1008ff40, XF86Launch0), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Jetzt kommt der problematische Teil: Wenn ich in KDE eine benutzerdefinierte Tastenkombination erstelle, wird sie zwar erfolgreich erkannt, XF86 keysym
z. B. WWW
oder Terminal
, aber das von mir bereitgestellte Skript wird nicht ausgeführt (die Tastenkombination wird also von KDE nicht erkannt).
Dies ist jedoch bei einigen anderen Tasten (in meine Haupttastatur integriert) nicht der Fall, z. B. XF86AudioPlay
.
Wie kann ich dieses Problem beheben?