mhub(1) GGI mhub(1)NAME
mhub - converts LibGII events to mouse protocol or mhub data
SYNOPSIS
mhub [options]
DESCRIPTION
mhub reads pointer events from the LibGII default device and outputs mouse protocol data and/or mhub data to the specified files. The
default device is specified with the GII_INPUT environment variable, see the libgii(7) manual for more info.
OPTIONS -h displays this help and exit
-v output version information and exit
-d print contents of received events to standard error
-s terminate program when a SIGPIPE signal is received. The default is to ignore SIGPIPE.
-e BUTNR
only generate mhub events for buttons >= BUTNR. The default is 4.
-b FILE
output mhub events to FILE
-2 FILE
output PS/2 format data to FILE
-i FILE
output (serial) IntelliMouse format data to FILE
-m FILE
output MouseSystems format data to FILE
-r FROM TO
remap button FROM to button TO
-w BUTNR
transform wheel up motion to a BUTNR mhub event
-W BUTNR
transform wheel down motion to a BUTNR mhub event
A maximum of 20 mhub event outputs and 20 mouse data outputs are supported. The number of remaps are unlimited and all remaps occur before
any other processing.
Mouse data outputs may all use different protocols.
libgii-1.0.x 2004-10-14 mhub(1)
Check Out this Related Man Page
gii_pmove_event(3) GGI gii_pmove_event(3)NAME
gii_pmove_event - LibGII pointer movement events
SYNOPSIS
#include <ggi/events.h>
typedef struct gii_pmove_event {
COMMON_DATA;
int32_t x, y; /* absolute/relative position */
int32_t z, wheel;
} gii_pmove_event;
DESCRIPTION
The gii_pmove_event structure is used to report change of pointer position. Depending on the event type, the values are either absolute or
relative.
GENERATED EVENTS
This structure is used for evPtrRelative and evPtrAbsolute events.
STRUCTURE MEMBERS
The gii_pmove_event structure describes pointer (mice, etc.) motion in terms of the x, y, z coordinates and the wheel values of the device.
The motion described may be relative (offset from the current location) or absolute (a specific location on the 'screen'), depending on
whether the event is of type evPtrRelative or evPtrAbsolute, respectively.
LibGII does not attempt to interpolate or keep track of the current pointer position. (This is the application's responsibility.) LibGII
may also report both relative and absolute pointer motion for the same input, which may happen when the mouse is being emulated using a
keyboard on an input/target that is normally reports absolute motion.
EXAMPLES
Input handling for applications expecting absolute pointer position:
{
static int mousex,mousey;
ggiEventPoll(vis, emKey|emPointer, NULL);
events = ggiEventsQueued(vis, emKey|emPointer);
while (events--) {
ggiEventRead(vis, &event, emKey|emPointer);
switch(event.any.type) {
case evPtrButtonPress:
switch(event.pbutton.button) {
case GII_PBUTTON_FIRST:
do_something_as_appropriate(mousex,mousey);
break;
case GII_PBUTTON_SECOND:
/* ... */
}
break;
case evPtrButtonRelease:
/* ... if needed ... */
break;
case evPtrAbsolute:
mousex = event.pmove.x;
mousey = event.pmove.y;
break;
case evPtrRelative:
mousex += event.pmove.x;
mousey += event.pmove.y;
break;
}
/* Constrain mouse in any case */
if (mousex < 0) mousex = 0;
if (mousey < 0) mousey = 0;
if (mousex > xmax) mousex = xmax;
if (mousey > ymax) mousey = ymax;
} /* while */
}
SEE ALSO gii_event(3)libgii-1.0.x 2006-12-30 gii_pmove_event(3)