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

Philippe Brochard pbrochard at common-lisp.net
Sun Oct 26 20:47:48 UTC 2008


Author: pbrochard
Date: Sun Oct 26 20:47:48 2008
New Revision: 193

Log:
unalias-modifiers: Convert a modifier alias in a real modifier. For example: :alt is :mod-1, :numlock is :mod-2...

Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/src/clfswm-keys.lisp
   clfswm/src/package.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sun Oct 26 20:47:48 2008
@@ -1,5 +1,11 @@
 2008-10-26  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-keys.lisp (unalias-modifiers): Convert a modifier
+	alias in a real modifier.
+
+	* src/package.lisp (*modifier-alias*): New list of modifier alias
+	For example: :alt is :mod-1, :numlock is :mod-2...
+
 	* src/tools.lisp (remove-hook): New function.
 
 	* src/clfswm-keys.lisp (with-capslock, without-capslock) 

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Sun Oct 26 20:47:48 2008
@@ -7,8 +7,6 @@
 ===============
 Should handle these soon.
 
-- Make alias for :mod-1 -> :alt   :mod-2 -> :numlock
-
 - Show config -> list and display documentation for all tweakable global variables. [Philippe]
    TODO :
    In ~/.clfswmrc:

Modified: clfswm/src/clfswm-keys.lisp
==============================================================================
--- clfswm/src/clfswm-keys.lisp	(original)
+++ clfswm/src/clfswm-keys.lisp	Sun Oct 26 20:47:48 2008
@@ -62,8 +62,15 @@
 (define-init-hash-table-key *info-mouse* "Mouse buttons actions in info mode")
 
 
+
+(defun unalias-modifiers (list)
+  (dolist (mod *modifier-alias*)
+    (setf list (substitute (second mod) (first mod) list)))
+  list)
+
 (defun key->list (key)
-  (list (first key) (modifiers->state (append (rest key) *default-modifiers*))))
+  (list (first key) (modifiers->state (append (unalias-modifiers (rest key))
+					      (unalias-modifiers *default-modifiers*)))))
 
 (defmacro define-define-key (name hashtable)
   (let ((name-key-fun (create-symbol "define-" name "-key-fun"))

Modified: clfswm/src/package.lisp
==============================================================================
--- clfswm/src/package.lisp	(original)
+++ clfswm/src/package.lisp	Sun Oct 26 20:47:48 2008
@@ -46,6 +46,12 @@
 This variable may be useful to speed up some slow version of CLX.
 It is particulary useful with CLISP/MIT-CLX.")
 
+(defparameter *modifier-alias* '((:alt :mod-1)     (:alt-l :mod-1)
+				 (:numlock :mod-2)
+				 (:super_l :mod-4)
+				 (:alt-r :mod-5)   (:alt-gr :mod-5)
+				 (:capslock :lock))
+  "Syntax: (modifier-alias effective-modifier)")
 
 
 (defparameter *display* nil)




More information about the clfswm-cvs mailing list