aboutsummaryrefslogtreecommitdiff
path: root/driver-csi.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver-csi.c')
-rw-r--r--driver-csi.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/driver-csi.c b/driver-csi.c
index 7f6b008..bb4b000 100644
--- a/driver-csi.c
+++ b/driver-csi.c
@@ -331,6 +331,33 @@ handle_csi_m (termo_t *tk, termo_key_t *key, int cmd, long *arg, int args)
return TERMO_RES_NONE;
}
+//
+// Handler for CSI I / CSI O focus events
+//
+
+static termo_result_t
+handle_csi_IO (termo_t *tk, termo_key_t *key, int cmd, long *arg, int args)
+{
+ (void) tk;
+ (void) arg;
+ (void) args;
+
+ switch (cmd &= 0xff)
+ {
+ case 'I':
+ key->type = TERMO_TYPE_FOCUS;
+ key->code.focused = true;
+ return TERMO_RES_KEY;
+ case 'O':
+ key->type = TERMO_TYPE_FOCUS;
+ key->code.focused = false;
+ return TERMO_RES_KEY;
+ default:
+ return TERMO_RES_NONE;
+ }
+ return TERMO_RES_NONE;
+}
+
termo_result_t
termo_interpret_mouse (termo_t *tk, const termo_key_t *key,
termo_mouse_event_t *event, int *button, int *line, int *col)
@@ -671,6 +698,9 @@ register_keys (void)
csi_handlers['M' - 0x20] = &handle_csi_m;
csi_handlers['m' - 0x20] = &handle_csi_m;
+ csi_handlers['I' - 0x20] = &handle_csi_IO;
+ csi_handlers['O' - 0x20] = &handle_csi_IO;
+
csi_handlers['R' - 0x20] = &handle_csi_R;
csi_handlers['y' - 0x20] = &handle_csi_y;