diff options
author | Vinay Bondhugula <vinayb@vmware.com> | 2008-01-29 22:15:22 -0800 |
---|---|---|
committer | Vinay Bondhugula <vinayb@vmware.com> | 2008-01-29 22:15:22 -0800 |
commit | d032d3c8b40e152cc0fd8409f910f23559873aaf (patch) | |
tree | 80dfb2e883d7fd33aacac5e7f0226481b8376262 /src/evdev_axes.c | |
parent | Initialise b_map_data to correct size. Bug #13991 (diff) | |
download | xf86-input-evdev-d032d3c8b40e152cc0fd8409f910f23559873aaf.tar.gz xf86-input-evdev-d032d3c8b40e152cc0fd8409f910f23559873aaf.tar.bz2 xf86-input-evdev-d032d3c8b40e152cc0fd8409f910f23559873aaf.zip |
Clear EV_ABS_V_USE_TOUCH for devices without a touch button
VMware's absolute pointing device does not have a pressure/touch button.
Although evdev correctly recognizes this, it sets "use_touch" for X and Y axes
regardless of the touch button. This patch clears the USE_TOUCH flag for the X
and Y axes if the device does not have a touch button.
Diffstat (limited to 'src/evdev_axes.c')
-rw-r--r-- | src/evdev_axes.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/evdev_axes.c b/src/evdev_axes.c index e967c61..5d196ab 100644 --- a/src/evdev_axes.c +++ b/src/evdev_axes.c @@ -709,6 +709,7 @@ EvdevAxisAbsNew1(InputInfoPtr pInfo) { int btn; + int i; s = xf86SetStrOption(pInfo->options, "AbsoluteTouch", "DIGI_Touch"); btn = EvdevBtnFind (pInfo, s); @@ -719,6 +720,18 @@ EvdevAxisAbsNew1(InputInfoPtr pInfo) xf86Msg(X_ERROR, "%s: state->btn: %p.\n", pInfo->name, state->btn); state->btn->callback[btn] = &EvdevAxesTouchCallback; } else { + + /* + * If the device does not have a touch button, then clear + * EV_ABS_V_USE_TOUCH which we may have set for the X and Y + * axes in EvdevAxisAbsNew. + */ + for (i = 0; i < ABS_MAX; i++) { + if ((i == ABS_X || i == ABS_Y) && + state->abs->v_flags[i] & EV_ABS_V_PRESENT) { + state->abs->v_flags[i] &= ~EV_ABS_V_USE_TOUCH; + } + } xf86Msg(X_ERROR, "%s: AbsoluteTouch: '%s' does not exist.\n", pInfo->name, s); } } else { |