summaryrefslogtreecommitdiff
path: root/main.scm
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2022-12-09 12:39:18 +0100
committerSamuel Fadel <samuel@nihil.ws>2022-12-09 12:39:18 +0100
commitcd3a1b7749ecfacd0dc47eb32bcae4b23cb439f9 (patch)
treec46e93cb901ad388bb95936d4a100a70f50f3844 /main.scm
parent6f54084c0ee63f4b341f8f92efbc8b82d3dfa224 (diff)
Implemented focus prev/next; cleanup on Scheme side.
* schewm.c: Implemented focus prev/next and minor helper func * main.scm and wm.scm: Added focus prev/next calls to C
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm23
1 files changed, 3 insertions, 20 deletions
diff --git a/main.scm b/main.scm
index a591764..f77acf2 100644
--- a/main.scm
+++ b/main.scm
@@ -30,30 +30,13 @@
0 ; offset-height
))
-(define (make-key key)
- (list #f (key-from-str key)))
-
-(define (make-shift-key key)
- (list #t (key-from-str key)))
-
(define wm-keybindings
`((,(make-shift-key "q") . ,wm-quit)
- (,(make-key "Tab") . ,wm-focus-next)))
-
-(define (grab-keys keybindings)
- (unless (null? keybindings)
- (let* ((keybinding (car keybindings))
- (chord (car keybinding))
- (func (cdr keybinding))
- (with-shift (car chord))
- (key (car (cdr chord))))
- (if with-shift
- (wm-grab-key-with-mod-shift key)
- (wm-grab-key-with-mod key))
- (grab-keys (cdr keybindings)))))
+ (,(make-key "Tab") . ,wm-focus-prev)
+ (,(make-shift-key "Tab") . ,wm-focus-next)))
(when (wm-init)
- (grab-keys wm-keybindings)
+ (wm-grab-keys wm-keybindings)
(wm-set-key-press-handler!
(lambda (mod keysym)
(display (list mod keysym))