You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/mdbook_asciio/src/config/binding_format.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,72 @@ register_action_handlers
118
118
'group_other_group_name'=> GROUP ( ...), # note that 'group_' is needed in the declaration of groups referred to by USE_GROUP
119
119
```
120
120
121
-
#### Macros
121
+
### Navigating groups programatically
122
+
123
+
There are two possibilities:
124
+
125
+
- run_actions
126
+
- run_actions_by name
127
+
128
+
*run_actions* runs actions in the current binding (it is used by *Asciio* to handle keyboard events).
129
+
130
+
*run_actions_by_name* executes one of more named functions (with optional arguments); the functions are registered in the default config.
131
+
132
+
*Asciio* looks up keyboard events and run the correxponding function in the current binding group.
133
+
134
+
Groups are also registered functions, functions that manipulates the current binding group.
135
+
136
+
We can programmatically manipulate the current bindings but it's much easier to define a group of bindings that we can make the active binding group; that's exactly what GROUP does.
137
+
138
+
To change the current keyboard bindings, we just need to run the right GROUP.
139
+
140
+
```perl
141
+
$self->run_actions_by_name("the GROUP name") ;
142
+
```
143
+
144
+
That's available anywhere but the right way to do it is in the config so we get a keyboard driven flow rather than a code driven flow with if-then-else.
145
+
146
+
The configuration below is to get in group 'x' from group 'Insert ->' and back.
147
+
148
+
Two solutions are presented, the difference is explained below.
149
+
150
+
Note: the normal behavior when exiting a GROUP, is to reset to the default keyboard bindings.
0 commit comments