[clfswm-cvs] r76 - in clfswm: . src

pbrochard at common-lisp.net pbrochard at common-lisp.net
Sun Apr 13 22:08:52 UTC 2008


Author: pbrochard
Date: Sun Apr 13 18:08:51 2008
New Revision: 76

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-keys.lisp
Log:
Handle all keysyms in the main mode (for example: 1 on an azerty keyboard).


Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sun Apr 13 18:08:51 2008
@@ -1,7 +1,12 @@
+2008-04-14  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-keys.lisp (define-ungrab/grab): Handle all keysyms in
+	the main mode (for example: "1" on an azerty keyboard).
+
 2008-04-13  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-keys.lisp (find-key-from-code): Better handle of
-	keysyms. Revert to hold grabning method for the main mode.
+	keysyms. Revert to hold grabbing method for the main mode.
 
 2008-04-12  Philippe Brochard  <pbrochard at common-lisp.net>
 

Modified: clfswm/src/clfswm-keys.lisp
==============================================================================
--- clfswm/src/clfswm-keys.lisp	(original)
+++ clfswm/src/clfswm-keys.lisp	Sun Apr 13 18:08:51 2008
@@ -99,6 +99,11 @@
 
 
 
+
+(defun add-in-state (state modifier)
+  "Add a modifier in a state"
+  (modifiers->state (append (state->modifiers state) (list modifier))))
+
 (defmacro define-ungrab/grab (name function hashtable)
   `(defun ,name ()
      (maphash #'(lambda (k v)
@@ -110,9 +115,11 @@
 			       (keycode (typecase key
 					  (character (char->keycode key))
 					  (number key)
-					  (string (let ((keysym (keysym-name->keysym key)))
-						    (when keysym
-						      (xlib:keysym->keycodes *display* keysym)))))))
+					  (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)))))
 			  (if keycode
 			      (,function *root* keycode :modifiers modifiers)
 			      (format t "~&Grabbing error: Can't find key '~A'~%" key)))



More information about the clfswm-cvs mailing list