diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-24 17:27:48 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-24 17:27:48 +0100 |
commit | f5cbf9eb57b0dd38ed8054eff02defec1602f57a (patch) | |
tree | 8f5d412e6ce36cd3639600d1b6aa92b819bf07f4 /driver-csi.c | |
parent | 6645ee971807c5257ca50b073d1dee4af0630fc7 (diff) | |
download | termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.tar.gz termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.tar.xz termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.zip |
Also handle CSI R; position report replies to CSI 6n
Diffstat (limited to 'driver-csi.c')
-rw-r--r-- | driver-csi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/driver-csi.c b/driver-csi.c index 1719e70..d305356 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -187,6 +187,21 @@ static TermKeyResult handle_csi_mouse(TermKey *tk, TermKeyKey *key, int cmd, lon return TERMKEY_RES_NONE; } +/* + * Handler for CSI R position reports + */ + +static TermKeyResult handle_csi_position(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args) +{ + if(args < 2) + return TERMKEY_RES_NONE; + + key->type = TERMKEY_TYPE_POSITION; + termkey_key_set_linecol(key, arg[0], arg[1]); + + return TERMKEY_RES_KEY; +} + static int register_keys(void) { int i; @@ -268,6 +283,8 @@ static int register_keys(void) csi_handlers['M' - 0x40] = &handle_csi_mouse; csi_handlers['m' - 0x40] = &handle_csi_mouse; + csi_handlers['R' - 0x40] = &handle_csi_position; + keyinfo_initialised = 1; return 1; } |