[clfswm-cvs] r358 - in clfswm: . contrib src

Philippe Brochard pbrochard at common-lisp.net
Sat Oct 23 20:02:15 UTC 2010


Author: pbrochard
Date: Sat Oct 23 16:02:14 2010
New Revision: 358

Log:
src/clfswm-keys.lisp (binding-substitute-modifier): Utility to change modifiers after binding definition.

Modified:
   clfswm/ChangeLog
   clfswm/contrib/keyb_fr.lisp
   clfswm/contrib/osd.lisp
   clfswm/src/clfswm-keys.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sat Oct 23 16:02:14 2010
@@ -1,3 +1,8 @@
+2010-10-23  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-keys.lisp (binding-substitute-modifier): Utility to
+	change modifiers after binding definition.
+
 2010-10-21  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* contrib/osd.lisp: New file: OSD (On Screen Display) for

Modified: clfswm/contrib/keyb_fr.lisp
==============================================================================
--- clfswm/contrib/keyb_fr.lisp	(original)
+++ clfswm/contrib/keyb_fr.lisp	Sat Oct 23 16:02:14 2010
@@ -2,7 +2,7 @@
 ;;; CLFSWM - FullScreen Window Manager
 ;;;
 ;;; --------------------------------------------------------------------------
-;;; Documentation: Music Player Daemon (MPD) interface
+;;; Documentation: Define some keybindings for an azerty french keyboard
 ;;; --------------------------------------------------------------------------
 ;;;
 ;;; (C) 2009 Philippe Brochard <hocwp at free.fr>

Modified: clfswm/contrib/osd.lisp
==============================================================================
--- clfswm/contrib/osd.lisp	(original)
+++ clfswm/contrib/osd.lisp	Sat Oct 23 16:02:14 2010
@@ -56,7 +56,6 @@
 
 
 ;;; Display menu functions
-
 (defun open-menu-do-action (action menu parent)
   (typecase action
     (menu (open-menu action (cons menu parent)))

Modified: clfswm/src/clfswm-keys.lisp
==============================================================================
--- clfswm/src/clfswm-keys.lisp	(original)
+++ clfswm/src/clfswm-keys.lisp	Sat Oct 23 16:02:14 2010
@@ -232,3 +232,19 @@
 
 
 
+(defun binding-substitute-modifier (to from &optional (hashtables (list *main-keys* *main-mouse*
+									*second-keys* *second-mouse*
+									*info-keys* *info-mouse*
+									*query-keys*
+									*circulate-keys* *circulate-keys-release*
+									*expose-keys* *expose-mouse*)))
+  "Utility to change modifiers after binding definition"
+  (labels ((change (&optional (hashtable *main-keys*) to from)
+	     (maphash (lambda (k v)
+			(when (consp k)
+			  (let ((state (modifiers->state (substitute to from (state->modifiers (second k))))))
+			    (remhash k hashtable)
+			    (setf (gethash (list (first k) state) hashtable) v))))
+		      hashtable)))
+    (dolist (h hashtables)
+      (change h to from))))




More information about the clfswm-cvs mailing list