From b763f2f26d756b14e54d30cd32743eb0ea269dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 14 Sep 2015 19:04:18 +0200 Subject: 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. --- editor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'editor.h') 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; -- cgit v1.2.3