devmouse: add twitch mousectl command

This commit is contained in:
cinap_lenrek 2012-02-13 07:06:08 +01:00
parent f9cc8808b7
commit 4780a7ff56
2 changed files with 10 additions and 0 deletions

View file

@ -150,6 +150,10 @@ unlike
.B reset
clears the mouse
to its default state.
.TP
.B twitch
unblanks the screen and resets the idle timeout as if the
mouse was twitched.
.PD
.PP
Not all mice interpret all messages; with some devices,

View file

@ -57,6 +57,7 @@ enum
CMbuttonmap,
CMscrollswap,
CMswap,
CMtwitch,
CMwildcard,
};
@ -65,6 +66,7 @@ static Cmdtab mousectlmsg[] =
CMbuttonmap, "buttonmap", 0,
CMscrollswap, "scrollswap", 0,
CMswap, "swap", 1,
CMtwitch, "twitch", 0,
CMwildcard, "*", 0,
};
@ -419,6 +421,10 @@ mousewrite(Chan *c, void *va, long n, vlong)
setbuttonmap(cb->f[1]);
break;
case CMtwitch:
drawactive(1);
break;
case CMwildcard:
mousectl(cb);
break;