-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use xcb-keysyms to parse keycodes #17
use xcb-keysyms to parse keycodes #17
Conversation
Warning: I merged this into my fork and blezz stopped to react on keystrokes. |
Hi @roomcays, can you test it again? Does the escape key exit the application when pressed? |
Hello @alpheratz0 . I can perform some debugging if you explain me how :) |
@roomcays well, thats strange, the first thing that I would test is if you are receiving any keyboard events, to do so can you add this printf call (the highlighted text without the plus signs) to src/gui.c (line 214 if you have merged both pull requests) and test again, press some keys (Escape, etc) and send me back whats printed out. diff --git a/src/gui.c b/src/gui.c
index 00ec99f..cbb3bb4 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -212,6 +212,14 @@ int handleKeyPress(xcb_generic_event_t* event) {
keycode = ((xcb_key_press_event_t *)event)->detail;
keysym = xcb_key_symbols_get_keysym(ksyms, keycode, state);
+ printf("\n"
+ "\tstate: %hu\n"
+ "\tkeycode: %hhu\n"
+ "\tkeysym: %u\n"
+ "\tESC keysym: %u\n"
+ "\tgetCharFromKeysym: %c\n",
+ state, keycode, keysym, XKB_KEY_Escape, getCharfromKeysym(keysym));
+
if (keysym == XKB_KEY_Escape) { //If the keycode represents escape
return 1;
} |
@alpheratz0 sure! Below is the output you asked for. I pressed: $ ./blezz
Loading config from: /home/user/.config/blezz/config
Loaded directoryUpKey as: .
Loaded actionIndicator as: ~
Loaded directoryIndicator as: /
Loaded startDirectory as: Main
Loaded windowWidth as: 800
Loaded showMenuNames as: 1
Loaded showMenuNamesNested as: 1
Loaded backgroundColor as: 0x313742
Loaded foregroundColor as: 0xf5f6f7
Loaded topIndentation as: 10
Loaded leftIndentation as: 20
Loaded bottomIndentation as: 10
Loaded windowXOffset as: 0
Loaded windowYOffset as: 0
Loaded windowXPosition as: 1
Loaded windowYPosition as: 1
Loading content from: /home/user/.config/blezz/content
Loaded 8 directories
Loaded 21 actions
state: 16
keycode: 38
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 56
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 54
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 40
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 50
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 17
keycode: 40
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 9
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 9
keysym: 0
ESC keysym: 65307
getCharFromKeysym:
state: 16
keycode: 9
keysym: 0
ESC keysym: 65307
getCharFromKeysym: I thought this could be connected with hotkey manager I use (sxhkd), but with it turned off (killed) the behavior is the same. |
@roomcays thanks, thats really nice, I think I found the problem, new commit going in the way, correct me if I am wrong, do you have NumLock turned on? |
NumLock and other modifiers alters the modifiers mask in an unwanted way, just allowing the shift modifier should fix this problem thank you @roomcays for reporting it!
Yes, I do have NumLock on (permamently) :) I'm so glad somebody besides me needs this kind of application (and can code in C ;-P). I was looking for alternatives over github.com and elsewhere and suprisingly find none. |
@roomcays thank you for reporting the problem and help me fix it! I am happy that this PR is useful for someone, I thought it will never be merged/useful because this project (and the account) is abandoned but you proved me wrong.
I really like minimalist applications, and this one is a very useful one ;) Have a nice day |
fixes #1