Sub-Module to handle physical controls that provide a range value (eg. potentiometers and rotary encoders).
A dial provides a powerful way to navigate through menus on a display.
- Precondition
- GFX_USE_GINPUT must be set to GFXON in your gfxconf.h
-
GINPUT_NEED_DIAL must be set to GFXON in your gfxconf.h
◆ ginputGetDial()
GSourceHandle ginputGetDial |
( |
gU16 |
instance | ) |
|
Create a dial input instance.
- Parameters
-
[in] | instance | The ID of the dial input instance (from 0 to 9999) |
- Returns
- The soure handle of the created dial instance
◆ ginputGetDialRange()
gU16 ginputGetDialRange |
( |
gU16 |
instance | ) |
|
Get the maximum value.
The readings are scaled to be 0 ... max.
- Parameters
-
[in] | instance | The ID of the dial input instance |
- Returns
- The maximum value
◆ ginputGetDialStatus()
gBool ginputGetDialStatus |
( |
gU16 |
instance, |
|
|
GEventDial * |
pdial |
|
) |
| |
Get the current dial status.
- Parameters
-
[in] | instance | The ID of the dial input instance |
[in] | pdial | The dial event struct |
- Returns
- Returns gFalse on an error (eg invalid instance)
◆ ginputResetDialRange()
void ginputResetDialRange |
( |
gU16 |
instance | ) |
|
Reset the value back to the hardware default.
- Parameters
-
[in] | instance | The ID of the dial input instance |
◆ ginputSetDialRange()
void ginputSetDialRange |
( |
gU16 |
instance, |
|
|
gU16 |
max |
|
) |
| |
Set the maximum value.
The readings are scaled to be 0 ... max.
- Parameters
-
[in] | instance | The ID of the dial input instance |
[in] | max | The maximum value to be set |
◆ ginputSetDialSensitivity()
void ginputSetDialSensitivity |
( |
gU16 |
instance, |
|
|
gU16 |
diff |
|
) |
| |
Set the level change required before a dial even is generated (threshold)
- Note
- This is done after range scaling
- Parameters
-
[in] | instance | The ID of the dial input instance |
[in] | diff | The amount of level changes |