Add functions to scroll the mouse up and down

This commit is contained in:
Bradlee Speice
2012-07-12 10:04:57 -04:00
parent 5150b2d7e4
commit e436323d7a
3 changed files with 68 additions and 0 deletions

View File

@ -486,6 +486,34 @@ void xte_mouseJiggle ( Display *displayLocation )
XFlush( displayLocation );
}
/*
* === FUNCTION ======================================================================
* Name: xte_mouseScrollUp
* Description: Scroll the mouse up
* =====================================================================================
*/
void xte_mouseScrollUp ( Display *displayLocation )
{
XTestFakeButtonEvent( displayLocation, 4, True, CurrentTime );
XTestFakeButtonEvent( displayLocation, 4, False, CurrentTime );
XFlush( displayLocation );
} /* ----- end of function xte_mouseScrollUp ----- */
/*
* === FUNCTION ======================================================================
* Name: xte_mouseScrollDown
* Description: Scroll the mouse down
* =====================================================================================
*/
void xte_mouseScrollDown ( Display *displayLocation )
{
XTestFakeButtonEvent( displayLocation, 5, True, CurrentTime );
XTestFakeButtonEvent( displayLocation, 5, False, CurrentTime );
XFlush( displayLocation );
} /* ----- end of function xte_mouseScrollDown ----- */
/*
* === FUNCTION ======================================================================
* Name: xte_clickKey
@ -688,6 +716,14 @@ cvaPoint xte_commandString ( Display *displayLocation, char *commandString, int
{
xte_mouseJiggle( displayLocation );
}
else if (IS_CMD( s_commandString, "mousescrollu" ))
{
xte_mouseScrollUp( displayLocation );
}
else if (IS_CMD( s_commandString, "mousescrolld" ))
{
xte_mouseScrollDown( displayLocation );
}
else if (IS_CMD( s_commandString, "keyclick" ))
{
char *key;