[clfswm-cvs] r300 - in clfswm: . src
Philippe Brochard
pbrochard at common-lisp.net
Thu Aug 26 19:24:52 UTC 2010
Author: pbrochard
Date: Thu Aug 26 15:24:52 2010
New Revision: 300
Log:
src/clfswm-keys.lisp (define-ungrab/grab): Use all values returned by xlib:keysym->keycodes.
Modified:
clfswm/ChangeLog
clfswm/src/bindings.lisp
clfswm/src/clfswm-keys.lisp
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Thu Aug 26 15:24:52 2010
@@ -1,5 +1,8 @@
2010-08-26 Philippe Brochard <pbrochard at common-lisp.net>
+ * src/clfswm-keys.lisp (define-ungrab/grab): Use all values
+ returned by xlib:keysym->keycodes.
+
* src/*.lisp: Use the new child-equal-p to compare children. This
prevent a bug with sbcl/cmucl when the standard equal function
does not work with xlib:window.
Modified: clfswm/src/bindings.lisp
==============================================================================
--- clfswm/src/bindings.lisp (original)
+++ clfswm/src/bindings.lisp Thu Aug 26 15:24:52 2010
@@ -68,6 +68,10 @@
;; Second mode
(define-main-key (#\t :mod-1) 'second-key-mode)
(define-main-key ("less" :control) 'second-key-mode)
+ (define-main-key ("Z" :control) 'second-key-mode)
+ ;;(define-main-key (#\< :control) 'second-key-mode)
+ ;;(define-main-key (#x003c :control) 'second-key-mode)
+ ;;(define-main-key (94 :control) 'second-key-mode)
;; Bind or jump functions
(define-main-key ("1" :mod-1) 'bind-or-jump 1)
(define-main-key ("2" :mod-1) 'bind-or-jump 2)
Modified: clfswm/src/clfswm-keys.lisp
==============================================================================
--- clfswm/src/clfswm-keys.lisp (original)
+++ clfswm/src/clfswm-keys.lisp Thu Aug 26 15:24:52 2010
@@ -144,15 +144,23 @@
(let* ((key (first k))
(modifiers (second k))
(keycode (typecase key
- (character (char->keycode key))
+ (character (multiple-value-list (char->keycode key)))
(number key)
(string (let* ((keysym (keysym-name->keysym key))
- (ret-keycode (xlib:keysym->keycodes *display* keysym)))
- (when (/= keysym (xlib:keycode->keysym *display* ret-keycode 0))
- (setf modifiers (add-in-state modifiers :shift)))
+ (ret-keycode (multiple-value-list (xlib:keysym->keycodes *display* keysym))))
+ (let ((found nil))
+ (dolist (kc ret-keycode)
+ (when (= keysym (xlib:keycode->keysym *display* kc 0))
+ (setf found t)))
+ (unless found
+ (setf modifiers (add-in-state modifiers :shift))))
ret-keycode)))))
+ (dbg key modifiers keycode)
(if keycode
- (,function *root* keycode :modifiers modifiers)
+ (if (consp keycode)
+ (dolist (kc (remove-duplicates keycode))
+ (,function *root* kc :modifiers modifiers))
+ (,function *root* keycode :modifiers modifiers))
(format t "~&Grabbing error: Can't find key '~A'~%" key)))
(error (c)
;;(declare (ignore c))
More information about the clfswm-cvs
mailing list