evas events: Add "raw" x,y values for future extensions

For pen tablets, this exposes the values as given by the driver
(quite useless without knowledge of the device itself).

For mice, this exposes x,y as set by the display manager, without
any extra processing in terms of smoothing or prediction. IOW
this returns the same as x,y until a smoothing algorithm is
implemented (todo).
This commit is contained in:
Jean-Philippe Andre 2016-09-01 18:34:10 +09:00
parent 7f22addf1c
commit d7b8d97fd5
3 changed files with 26 additions and 2 deletions

View File

@ -33,6 +33,10 @@ struct _Efl_Input_Pointer_Data
double radius, radius_x, radius_y;
double pressure, distance, azimuth, tilt, twist;
double angle;
/* current, previous positions in window coordinates.
* raw can be either un-smoothed, un-predicted x,y or a tablet's raw input.
* norm is the normalized value in [0..1] for tablet input.
*/
Eina_Vector2 cur, prev, raw, norm;
struct {
Efl_Orient dir;

View File

@ -88,15 +88,25 @@ enum Efl.Input.Value {
tool, [[ID of the finger or tool (eg. pen) that triggered this event.
Prefer the property $tool to read this value. Default: 0.]]
x, [[Absolute X position where this event occurred, in pixels.
Relative to the window. Default: last known position.]]
Relative to the window. Default: last known position.
This value may be smoothed out or even extrapolated by EFL.]]
y, [[Absolute Y position where this event occurred, in pixels.
Relative to the window. Default: last known position.]]
Relative to the window. Default: last known position.
This value may be smoothed out or even extrapolated by EFL.]]
dx, [[Relative X movement, in pixels. Range: unbounded. Default: 0.]]
dy, [[Relative Y movement, in pixels. Range: unbounded. Default: 0.]]
previous_x, [[Previous X position of the pointer, in pixels.
Default: last known position, may be equal to x.]]
previous_y, [[Previous Y position of the pointer, in pixels.
Default: last known position, may be equal to y.]]
raw_x, [[Absolute X position where this event occurred. Default: 0.
This value will be set from the hardware input without any
smoothing or extrapolation. For an axis input event, this is
the raw value set by the driver (undefined range and unit).]]
raw_y, [[Absolute X position where this event occurred. Default: 0.
This value will be set from the hardware input without any
smoothing or extrapolation. For an axis input event, this is
the raw value set by the driver (undefined range and unit).]]
radius, [[Average radius of the pressed area under a finger or tool,
in pixels. Default is 1.]]
radius_x, [[Spread over X of the pressed area under a finger or tool,

View File

@ -525,6 +525,16 @@ _efl_input_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Ef
case EFL_INPUT_VALUE_PREVIOUS_Y:
return pd->prev.y;
case EFL_INPUT_VALUE_RAW_X:
if (!_efl_input_value_has(pd, EFL_INPUT_VALUE_RAW_X))
return pd->cur.x;
return pd->raw.x;
case EFL_INPUT_VALUE_RAW_Y:
if (!_efl_input_value_has(pd, EFL_INPUT_VALUE_RAW_Y))
return pd->cur.y;
return pd->raw.y;
case EFL_INPUT_VALUE_RADIUS:
return pd->radius;