aboutsummaryrefslogtreecommitdiffstats
path: root/libterminput.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-06 17:53:09 +0200
committerMattias Andrée <maandree@kth.se>2021-04-06 17:55:01 +0200
commit8f09401e3d7d238355391e4abf3746987c95c492 (patch)
tree5b53b0ceee4610ebc89f9fb878208edcc0cf57f1 /libterminput.h
parentAdd more key codes (diff)
downloadlibterminput-8f09401e3d7d238355391e4abf3746987c95c492.tar.gz
libterminput-8f09401e3d7d238355391e4abf3746987c95c492.tar.bz2
libterminput-8f09401e3d7d238355391e4abf3746987c95c492.tar.xz
Add support for bracketed paste
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libterminput.h')
-rw-r--r--libterminput.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/libterminput.h b/libterminput.h
index 4e33d09..d2f505f 100644
--- a/libterminput.h
+++ b/libterminput.h
@@ -60,7 +60,10 @@ enum libterminput_key {
enum libterminput_type {
LIBTERMINPUT_NONE,
- LIBTERMINPUT_KEYPRESS
+ LIBTERMINPUT_KEYPRESS,
+ LIBTERMINPUT_BRACKETED_PASTE_START,
+ LIBTERMINPUT_BRACKETED_PASTE_END,
+ LIBTERMINPUT_TEXT
};
struct libterminput_keypress {
@@ -71,9 +74,16 @@ struct libterminput_keypress {
char symbol[7]; /* use if .key == LIBTERMINPUT_SYMBOL */
};
+struct libterminput_text {
+ enum libterminput_type type;
+ size_t nbytes;
+ char bytes[512];
+};
+
union libterminput_input {
enum libterminput_type type;
- struct libterminput_keypress keypress;
+ struct libterminput_keypress keypress; /* use if .type == LIBTERMINPUT_KEYPRESS */
+ struct libterminput_text text; /* use if .type == LIBTERMINPUT_TEXT */
};
@@ -83,13 +93,15 @@ union libterminput_input {
struct libterminput_state {
int inited; /* whether the input in initialised, not this struct */
enum libterminput_mod mods;
+ size_t stored_head;
+ size_t stored_tail;
+ char bracketed_paste;
char meta;
char n;
- char have_stored;
char npartial;
- char stored;
char partial[7];
char key[44];
+ char stored[512];
};