These functions are declared in the main Allegro header file:
#include <allegro5/allegro.h>
typedef struct ALLEGRO_TOUCH_INPUT ALLEGRO_TOUCH_INPUT;
An abstract data type representing a physical touch screen or touch pad.
Since: 5.1.0
#define ALLEGRO_TOUCH_INPUT_MAX_TOUCH_COUNT 16
The maximum amount of simultaneous touches that can be detected.
Since: 5.1.0
typedef struct ALLEGRO_TOUCH_STATE ALLEGRO_TOUCH_STATE;
This is a structure that is used to hold a “snapshot” of a touch at a particular instant.
Public fields (read only):
Since: 5.1.0
typedef struct ALLEGRO_TOUCH_INPUT_STATE ALLEGRO_TOUCH_INPUT_STATE;
This is a structure that holds a snapshot of all simultaneous touches at a particular instant.
Public fields (read only):
Since: 5.1.0
typedef enum ALLEGRO_MOUSE_EMULATION_MODE
Type of mouse emulation to apply.
Since: 5.1.0
Unstable API: Seems of limited value, as touch input tends to have different semantics compared to mouse input.
bool al_install_touch_input(void)
Install a touch input driver, returning true if successful. If a touch input driver was already installed, returns true immediately.
Since: 5.1.0
See also: al_uninstall_touch_input
Examples:
void al_uninstall_touch_input(void)
Uninstalls the active touch input driver. If no touch input driver was active, this function does nothing.
This function is automatically called when Allegro is shut down.
Since: 5.1.0
See also: al_install_touch_input
bool al_is_touch_input_installed(void)
Returns true if al_install_touch_input was called successfully.
Since: 5.1.0
Examples:
void al_get_touch_input_state(ALLEGRO_TOUCH_INPUT_STATE *ret_state)
Gets the current touch input state. The touch information is copied into the ALLEGRO_TOUCH_INPUT_STATE you provide to this function.
Since: 5.1.0
void al_set_mouse_emulation_mode(int mode)
Sets the kind of mouse emulation for the touch input subsystem to perform.
Since: 5.1.0
Unstable API: Seems of limited value, as touch input tends to have different semantics compared to mouse input.
See also: ALLEGRO_MOUSE_EMULATION_MODE, al_get_mouse_emulation_mode.
Examples:
int al_get_mouse_emulation_mode(void)
Returns the kind of mouse emulation which the touch input subsystem is set to perform.
Since: 5.1.0
Unstable API: Seems of limited value, as touch input tends to have different semantics compared to mouse input.
See also: ALLEGRO_MOUSE_EMULATION_MODE, al_set_mouse_emulation_mode.
*al_get_touch_input_event_source(void) ALLEGRO_EVENT_SOURCE
Returns the global touch input event source. This event source generates touch input events.
Since: 5.1.0
See also: ALLEGRO_EVENT_SOURCE, al_register_event_source
Examples:
*al_get_touch_input_mouse_emulation_event_source(void) ALLEGRO_EVENT_SOURCE
Returns the global touch input event source for emulated mouse events. This event source generates emulated mouse events that are based on touch events.
See also: ALLEGRO_EVENT_SOURCE, al_register_event_source
Since: 5.1.0
Unstable API: Seems of limited value, as touch input tends to have different semantics compared to mouse input.
Examples: