[sawfish] explained macros (aka 'nested keybindings')



commit b64a43dd32802ecfe9dcba3ee4eb8240079fe441
Author: chrisb <zanghar freenet de>
Date:   Sat Sep 26 13:09:34 2009 +0200

    explained macros (aka 'nested keybindings')

 KEYBINDINGS |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/KEYBINDINGS b/KEYBINDINGS
index 9b405ed..8287a87 100644
--- a/KEYBINDINGS
+++ b/KEYBINDINGS
@@ -111,6 +111,24 @@ for example:
 
 ( unbind-keys global-keymap "W-Tab" 'cycle-windows )
 
+another thing would be nested keybindings (I prefer `macros' instead of `nested keyinbindgs'),
+like in emacs. nested means you first press keys which together act as a new modifier 
+(this new modifier works like the compose key does -> you don't have to keep it pressed, like other modifiers),
+then you press another key (or keybinding) to actually perform the desired action, example:
+
+;; create a new meta-keymap called apps-keymap
+( define apps-keymap ( make-keymap ) )
+
+;; glue it into the global-keymap, make the apps-keymap modifier W-e (WM-Modifier + e)
+( bind-keys global-keymap "W-e" apps-keymap )
+
+;; add bindings to the apps-keymap
+( bind-keys apps-keymap "b" '( system "bluefish &" ) )
+
+now first press "W-e" (as I said no need to keep it pressed) and press b, now bluefish starts.
+
+Explanation of Keymaps (+ default bindings)
+
 global-keymap (Those bindings are active everywhere):
 
 W-Left -> Previous Workspace



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]