From 043a183d1465f578775e2a28bdc0a5c44afccd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 28 Jan 2017 14:03:57 +0100 Subject: vis: keep track of most recently processed keys of input queue Currently the key handling functions do not know through which mapping they were invoked. As an example the `count` handler exploits the implementation detail that the input queue is stored in contiguous memory, meaning `keys[-1]` gives access to the digit being pressed. This adds infrastructure to keep track of the two most recently processed keys of the input queue. The information is guaranteed to be accurate for the initial invocation of the key handler but will be overwritten in case new keys are pushed to the input queue (e.g. through vis_keys_feed). --- vis.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index a57ff94..6ea3d1d 100644 --- a/vis.h +++ b/vis.h @@ -27,6 +27,9 @@ typedef struct Win Win; #define VIS_COMPLETE "vis-complete" #endif +/* maximum bytes needed for string representation of a (pseudo) key */ +#define VIS_KEY_LENGTH_MAX 64 + typedef struct { void (*init)(Vis*); void (*start)(Vis*); -- cgit v1.2.3