wm_handle_key(win, key, MOD(), PTR());
}
else if (type == ConfigureNotify) {
- //printf("configure: %d\n", type);
+ printf("configure: %d\n", type);
}
else if (type == MapNotify) {
- //printf("map: %d\n", type);
+ printf("map: %d\n", type);
}
else if (type == UnmapNotify) {
//printf("unmap: %d\n", type);
#include "sys.h"
#include "wm.h"
-#define MODKEY ctrl
+#define MODKEY alt
#define MARGIN 10
/* Loca types */
if (key == key_enter)
set_focus(win);
+ /* Reset focus after after focus change,
+ * not sure what is causing the focus change in the first place
+ * but preventing that would be a better solution */
+ if (key == key_focus)
+ set_focus(wm_focus);
+
return 0;
}
/* Initialize window */
win->wm = new0(win_wm_t);
sys_watch(win, key_enter, MOD());
+ sys_watch(win, key_focus, MOD());
/* Add to screen */
list_t *lcol = wm_focus && wm_focus->wm ?
/* Arrange */
arrange(wm_cols);
+ sys_focus(wm_focus);
print_txt(wm_cols);
}
sys_watch(root, key_mouse1, MOD(.MODKEY=1));
sys_watch(root, key_mouse3, MOD(.MODKEY=1));
sys_watch(root, key_enter, MOD());
+ sys_watch(root, key_focus, MOD());
Key_t keys[] = {'h', 'j', 'k', 'l'};
for (int i = 0; i < countof(keys); i++) {
sys_watch(root, keys[i], MOD(.MODKEY=1));