ecore_input: add API to set/get deadzone of joystick event for an axis.

Summary:
The axis type joystick event could occur without user's control if joystick is too sensitive.
The deadzone prevents this unnecessary event. The default value is 200.
The event value for an axis is a signed integer between -32767 and +32767.

Test Plan: Using example

Reviewers: raster, cedric, jpeg

Reviewed By: jpeg

Subscribers: stefan_schmidt

Differential Revision: https://phab.enlightenment.org/D4654
This commit is contained in:
Shinwoo Kim 2017-02-15 13:00:13 +09:00 committed by Jean-Philippe Andre
parent 5e60cd2863
commit 3a35dab1ca
1 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@
static Eina_Bool
_joystick_event_handler_cb(void *data, int type EINA_UNUSED, void *event)
{
printf("deadzone: %d\n", ecore_input_joystick_event_axis_deadzone_get());
Ecore_Event_Joystick *ev = event;
switch (ev->type)
{
@ -50,6 +51,7 @@ main(void)
ecore_event_handler_add(ECORE_EVENT_JOYSTICK,
_joystick_event_handler_cb,
NULL);
ecore_input_joystick_event_axis_deadzone_set(300);
printf("start the main loop.\n");