aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 15:01:20 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 15:01:20 +0000
commitfdb44d979633db2a4678d87769cfd3d9accae8c0 (patch)
treeeba8ff1b51a3ef64bd9d67ea426cc6d540375db4 /termkey.c
parentb87ca771bf103b21abf53ef4186aa1adaf002541 (diff)
downloadtermo-fdb44d979633db2a4678d87769cfd3d9accae8c0.tar.gz
termo-fdb44d979633db2a4678d87769cfd3d9accae8c0.tar.xz
termo-fdb44d979633db2a4678d87769cfd3d9accae8c0.zip
Moved the other termkey_interpret_*() functions into driver-csi.c where they arguably belong
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/termkey.c b/termkey.c
index 2bd6da1..a366636 100644
--- a/termkey.c
+++ b/termkey.c
@@ -910,69 +910,6 @@ static TermKeyResult peekkey_mouse(TermKey *tk, TermKeyKey *key, size_t *nbytep)
return TERMKEY_RES_KEY;
}
-TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKeyMouseEvent *event, int *button, int *line, int *col)
-{
- if(key->type != TERMKEY_TYPE_MOUSE)
- return TERMKEY_RES_NONE;
-
- if(button)
- *button = 0;
-
- termkey_key_get_linecol(key, line, col);
-
- if(!event)
- return TERMKEY_RES_KEY;
-
- int btn = 0;
-
- int code = key->code.mouse[0];
-
- int drag = code & 0x20;
-
- code &= ~0x3c;
-
- switch(code) {
- case 0:
- case 1:
- case 2:
- *event = drag ? TERMKEY_MOUSE_DRAG : TERMKEY_MOUSE_PRESS;
- btn = code + 1;
- break;
-
- case 3:
- *event = TERMKEY_MOUSE_RELEASE;
- // no button hint
- break;
-
- case 64:
- case 65:
- *event = drag ? TERMKEY_MOUSE_DRAG : TERMKEY_MOUSE_PRESS;
- btn = code + 4 - 64;
- break;
-
- default:
- *event = TERMKEY_MOUSE_UNKNOWN;
- }
-
- if(button)
- *button = btn;
-
- if(key->code.mouse[3] & 0x80)
- *event = TERMKEY_MOUSE_RELEASE;
-
- return TERMKEY_RES_KEY;
-}
-
-TermKeyResult termkey_interpret_position(TermKey *tk, const TermKeyKey *key, int *line, int *col)
-{
- if(key->type != TERMKEY_TYPE_POSITION)
- return TERMKEY_RES_NONE;
-
- termkey_key_get_linecol(key, line, col);
-
- return TERMKEY_RES_KEY;
-}
-
TermKeyResult termkey_getkey(TermKey *tk, TermKeyKey *key)
{
size_t nbytes = 0;