summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_xi2.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_xi2.c b/src/lib/ecore_x/xlib/ecore_x_xi2.c
index be19de2c94..089c2a7029 100644
--- a/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -494,7 +494,7 @@ _ecore_x_input_axis_handler(XEvent *xevent, XIDeviceInfo *dev)
494{ 494{
495 if (xevent->type != GenericEvent) return; 495 if (xevent->type != GenericEvent) return;
496 XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data); 496 XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data);
497 unsigned int n = _ecore_x_count_bits(*evd->valuators.mask); 497 unsigned int n = _ecore_x_count_bits(*evd->valuators.mask) + 4;
498 int i; 498 int i;
499 int j = 0; 499 int j = 0;
500 double tiltx = 0, tilty = 0; 500 double tiltx = 0, tilty = 0;
@@ -514,15 +514,29 @@ _ecore_x_input_axis_handler(XEvent *xevent, XIDeviceInfo *dev)
514 { 514 {
515 if (inf->label == _ecore_x_input_get_axis_label("Abs X")) 515 if (inf->label == _ecore_x_input_get_axis_label("Abs X"))
516 { 516 {
517 int x = evd->valuators.values[j];
517 axis_ptr->label = ECORE_AXIS_LABEL_X; 518 axis_ptr->label = ECORE_AXIS_LABEL_X;
518 axis_ptr->value = evd->valuators.values[j]; 519 axis_ptr->value = x;
519 axis_ptr++; 520 axis_ptr++;
521 if (inf->max > inf->min)
522 {
523 axis_ptr->label = ECORE_AXIS_LABEL_NORMAL_X;
524 axis_ptr->value = (x - inf->min) / (inf->max - inf->min);
525 axis_ptr++;
526 }
520 } 527 }
521 else if (inf->label == _ecore_x_input_get_axis_label("Abs Y")) 528 else if (inf->label == _ecore_x_input_get_axis_label("Abs Y"))
522 { 529 {
530 int y = evd->valuators.values[j];
523 axis_ptr->label = ECORE_AXIS_LABEL_Y; 531 axis_ptr->label = ECORE_AXIS_LABEL_Y;
524 axis_ptr->value = evd->valuators.values[j]; 532 axis_ptr->value = y;
525 axis_ptr++; 533 axis_ptr++;
534 if (inf->max > inf->min)
535 {
536 axis_ptr->label = ECORE_AXIS_LABEL_NORMAL_Y;
537 axis_ptr->value = (y - inf->min) / (inf->max - inf->min);
538 axis_ptr++;
539 }
526 } 540 }
527 else if (inf->label == _ecore_x_input_get_axis_label("Abs Pressure")) 541 else if (inf->label == _ecore_x_input_get_axis_label("Abs Pressure"))
528 { 542 {
@@ -602,6 +616,15 @@ _ecore_x_input_axis_handler(XEvent *xevent, XIDeviceInfo *dev)
602 n = (axis_ptr - axis); 616 n = (axis_ptr - axis);
603 if (n > 0) 617 if (n > 0)
604 { 618 {
619 /* event position in the window - most useful */
620 axis_ptr->label = ECORE_AXIS_LABEL_WINDOW_X;
621 axis_ptr->value = evd->event_x;
622 axis_ptr++;
623 axis_ptr->label = ECORE_AXIS_LABEL_WINDOW_Y;
624 axis_ptr->value = evd->event_y;
625 axis_ptr++;
626 n += 2;
627
605 shrunk_axis = realloc(axis, n * sizeof(Ecore_Axis)); 628 shrunk_axis = realloc(axis, n * sizeof(Ecore_Axis));
606 if (shrunk_axis != NULL) axis = shrunk_axis; 629 if (shrunk_axis != NULL) axis = shrunk_axis;
607 _ecore_x_axis_update(evd->child ? evd->child : evd->event, 630 _ecore_x_axis_update(evd->child ? evd->child : evd->event,