Archived
2
0

test if XKeysymToKeycode returns zero

This commit is contained in:
Miroslav Šedivý 2020-06-13 13:29:16 +02:00
parent 5b23448144
commit 19c6b8c4ae

View File

@ -97,9 +97,12 @@ void XButton(unsigned int button, int down) {
void XKey(unsigned long key, int down) { void XKey(unsigned long key, int down) {
Display *display = getXDisplay(); Display *display = getXDisplay();
KeyCode code = XKeysymToKeycode(display, key); KeyCode code = XKeysymToKeycode(display, key);
if (code != 0) {
XTestFakeKeyEvent(display, code, down, CurrentTime); XTestFakeKeyEvent(display, code, down, CurrentTime);
XSync(display, 0); XSync(display, 0);
} }
}
void XClipboardSet(char *src) { void XClipboardSet(char *src) {
clipboard_c *cb = getClipboard(); clipboard_c *cb = getClipboard();