Merge pull request #89 from m1k1o/master

BUG: XKeysymToKeycode returns zero
This commit is contained in:
Nurdism 2020-06-13 09:44:58 -04:00 committed by GitHub
commit ca0b5b2d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,8 +97,11 @@ 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);
XTestFakeKeyEvent(display, code, down, CurrentTime);
XSync(display, 0); if (code != 0) {
XTestFakeKeyEvent(display, code, down, CurrentTime);
XSync(display, 0);
}
} }
void XClipboardSet(char *src) { void XClipboardSet(char *src) {