aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-09-14 19:04:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-10-05 15:56:21 +0200
commitb763f2f26d756b14e54d30cd32743eb0ea269dc7 (patch)
treefd082abbf993717e36548a47275a963a3d254aa7 /editor.h
parenta76057df97157dc76959bcd40649f5953aebc9d3 (diff)
downloadvis-b763f2f26d756b14e54d30cd32743eb0ea269dc7.tar.gz
vis-b763f2f26d756b14e54d30cd32743eb0ea269dc7.tar.xz
vis: change key binding function prototypes
The idea is to work more like a finite state machine. Every function gets an additional argument keys which holds the already read keyboard input. The return value of the functions should point to the first not consumed key. A return value of NULL indicates that more input is needed. The function will be called again from the editor core when more input is available. These changes are mostly mechanical and in many cases not optimal, they will be cleaned up in further commits.
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor.h b/editor.h
index 2c500a9..3b555bf 100644
--- a/editor.h
+++ b/editor.h
@@ -29,7 +29,9 @@ typedef union {
typedef struct {
const char *key;
- void (*func)(const Arg *arg);
+ const char* (*func)(const char *keys, const Arg*);
+ /* returns a pointer to the first not consumed character in keys
+ * or NULL if not enough input was available to complete the command */
const Arg arg;
} KeyBinding;