Sub-Module to handle touchscreens and mices.
Both resistive and capacitive touchscreens are supported.
- Precondition
- GFX_USE_GINPUT must be set to GFXON in your gfxconf.h
-
GINPUT_NEED_MOUSE must be set to GFXON in your gfxconf.h
◆ ginputCalibrateMouse()
gU32 ginputCalibrateMouse |
( |
unsigned |
instance | ) |
|
Performs a calibration.
- Parameters
-
[in] | instance | The ID of the mouse input instance |
- Returns
- The calibration error squared if calibration fails, or 0 on success or if the driver dosen't need calibration.
- Note
- An invalid instance will also return 0.
◆ ginputGetMouse()
GSourceHandle ginputGetMouse |
( |
unsigned |
instance | ) |
|
Get the Source handler for a mouse using the instance number.
- Parameters
-
[in] | instance | The mouse instance number |
- Returns
- The source handle of the mouse or NULL
- Note
- You can use the special value of GMOUSE_ALL_INSTANCES to get a source handle that returns events for all mice rather than a specific mouse. Using GMOUSE_ALL_INSTANCES will always return a valid spurce handle even if there are currently no mice in the system.
◆ ginputGetMouseDisplay()
GDisplay* ginputGetMouseDisplay |
( |
unsigned |
instance | ) |
|
Get the display currently associated with the mouse.
- Returns
- A pointer to the display
- Parameters
-
[in] | instance | The ID of the mouse input instance |
◆ ginputGetMouseStatus()
gBool ginputGetMouseStatus |
( |
unsigned |
instance, |
|
|
GEventMouse * |
pmouse |
|
) |
| |
Get the current mouse position and button status.
- Note
- Unlinke a listener event, this status cannot record meta events such as "CLICK".
- Parameters
-
[in] | instance | The ID of the mouse input instance |
[in] | pmouse | The mouse event |
- Returns
- gFalse on an error (eg. invalid instance)
◆ ginputSetFingerMode()
void ginputSetFingerMode |
( |
unsigned |
instance, |
|
|
gBool |
on |
|
) |
| |
Should this device be in Pen mode or Finger mode.
- Note
- A touch device (and even theoritically a mouse) can operate in either pen or finger mode. In finger mode typically a touch device will be far more tolerant of movement and other inaccuracies. Each driver specifies its own tolerances for pen versus finger mode.
- Parameters
-
[in] | instance | The ID of the mouse input instance |
[in] | on | If true then finger mode is turned on. |
◆ ginputSetMouseDisplay()
void ginputSetMouseDisplay |
( |
unsigned |
instance, |
|
|
GDisplay * |
g |
|
) |
| |
Assign the display associated with the mouse.
- Note
- This only needs to be called if the mouse is associated with a display other than the current default display. It must be called before
ginputGetMouse()
if the new display is to be used during the calibration process. Other than calibration the display is used for range checking, and may also be used to display a mouse pointer.
- Parameters
-
[in] | instance | The ID of the mouse input instance |
[in] | g | The GDisplay to which this mouse belongs |
◆ LoadMouseCalibration()
gBool LoadMouseCalibration |
( |
unsigned |
instance, |
|
|
void * |
data, |
|
|
gMemSize |
sz |
|
) |
| |
Load a set of mouse calibration data.
- Returns
- A pointer to the data or NULL on failure
- Parameters
-
[in] | instance | The mouse input instance number |
[in] | data | Where the data should be placed |
[in] | sz | The size in bytes of the data to retrieve. |
- Note
- This routine is provided by the user application. It is only called if GINPUT_TOUCH_USER_CALIBRATION_LOAD has been set to GFXON in the users gfxconf.h file.
◆ SaveMouseCalibration()
gBool SaveMouseCalibration |
( |
unsigned |
instance, |
|
|
const void * |
data, |
|
|
gMemSize |
sz |
|
) |
| |
Save a set of mouse calibration data.
- Returns
- gTrue if the save operation was successful.
- Parameters
-
[in] | instance | The mouse input instance number |
[in] | data | The data to save |
[in] | sz | The size in bytes of the data to retrieve. |
- Note
- This routine is provided by the user application. It is only called if GINPUT_TOUCH_USER_CALIBRATION_SAVE has been set to GFXON in the users gfxconf.h file.