summaryrefslogtreecommitdiff
path: root/xC.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-23 09:37:23 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-23 09:42:24 +0200
commitf2d8de3ab92321419005b6f2bd6834dacda4cdb7 (patch)
treeda546d3e1be2e7c6547a1f31f1ec38a6d179bac9 /xC.c
parent67d52a2d89f4df328e018ac1831ed917236bce90 (diff)
downloadxK-f2d8de3ab92321419005b6f2bd6834dacda4cdb7.tar.gz
xK-f2d8de3ab92321419005b6f2bd6834dacda4cdb7.tar.xz
xK-f2d8de3ab92321419005b6f2bd6834dacda4cdb7.zip
xP: support adding formatting from keyboard
Just like in xC, only with some indication.
Diffstat (limited to 'xC.c')
-rw-r--r--xC.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xC.c b/xC.c
index d01c780..1b90964 100644
--- a/xC.c
+++ b/xC.c
@@ -15010,21 +15010,28 @@ process_formatting_escape (const struct pollfd *fd, struct app_context *ctx)
if (buf->len != 1)
goto error;
+
+ // Letters mostly taken from their caret escapes + HTML element names.
+ // Additionally, 'm' stands for mono, 'x' for cross, 'r' for reset.
switch (buf->str[0])
{
case 'b' ^ 96:
case 'b': CALL_ (ctx->input, insert, "\x02"); break;
case 'c': CALL_ (ctx->input, insert, "\x03"); break;
+ case 'q':
+ case 'm': CALL_ (ctx->input, insert, "\x11"); break;
+ case 'v': CALL_ (ctx->input, insert, "\x16"); break;
case 'i' ^ 96:
case 'i':
case ']': CALL_ (ctx->input, insert, "\x1d"); break;
+ case 's' ^ 96:
+ case 's':
case 'x' ^ 96:
case 'x':
case '^': CALL_ (ctx->input, insert, "\x1e"); break;
case 'u' ^ 96:
case 'u':
case '_': CALL_ (ctx->input, insert, "\x1f"); break;
- case 'v': CALL_ (ctx->input, insert, "\x16"); break;
case 'r':
case 'o': CALL_ (ctx->input, insert, "\x0f"); break;