diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-05 00:54:59 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-05-10 09:42:36 +1000 |
commit | 0903d99ada1755f11a2a5cbf89a345de896e18ec (patch) | |
tree | d2b2605a964e52c184885a2c77c3c098464295db /src | |
parent | 54f65f3ca1f7a7118bea96915d79acee28721581 (diff) |
Purge scrollbuttons (repeat)
I doubt devices that have scrollbuttons are still manufactured. Having
untested code around is just asking for trouble.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/properties.c | 56 | ||||
-rw-r--r-- | src/synaptics.c | 121 | ||||
-rw-r--r-- | src/synapticsstr.h | 10 |
3 files changed, 1 insertions, 186 deletions
diff --git a/src/properties.c b/src/properties.c index 0c422fb..3d6be7e 100644 --- a/src/properties.c +++ b/src/properties.c @@ -69,9 +69,6 @@ Atom prop_speed = 0; Atom prop_edgemotion_pressure = 0; Atom prop_edgemotion_speed = 0; Atom prop_edgemotion_always = 0; -Atom prop_buttonscroll = 0; -Atom prop_buttonscroll_repeat = 0; -Atom prop_buttonscroll_time = 0; Atom prop_off = 0; Atom prop_lockdrags = 0; Atom prop_lockdrags_time = 0; @@ -251,22 +248,6 @@ InitDeviceProperties(InputInfoPtr pInfo) fvalues[3] = 0; prop_speed = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_SPEED, 4, fvalues); - if (priv->has_scrollbuttons) { - values[0] = para->updown_button_scrolling; - values[1] = para->leftright_button_scrolling; - prop_buttonscroll = - InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values); - - values[0] = para->updown_button_repeat; - values[1] = para->leftright_button_repeat; - prop_buttonscroll_repeat = - InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, - values); - prop_buttonscroll_time = - InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, - ¶->scroll_button_repeat); - } - prop_off = InitAtom(pInfo->dev, SYNAPTICS_PROP_OFF, 8, 1, ¶->touchpad_off); prop_lockdrags = @@ -542,43 +523,6 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, para->max_speed = speed[1]; para->accl = speed[2]; } - else if (property == prop_buttonscroll) { - BOOL *scroll; - - if (!priv->has_scrollbuttons) - return BadMatch; - - if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER) - return BadMatch; - - scroll = (BOOL *) prop->data; - para->updown_button_scrolling = scroll[0]; - para->leftright_button_scrolling = scroll[1]; - - } - else if (property == prop_buttonscroll_repeat) { - BOOL *repeat; - - if (!priv->has_scrollbuttons) - return BadMatch; - - if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER) - return BadMatch; - - repeat = (BOOL *) prop->data; - para->updown_button_repeat = repeat[0]; - para->leftright_button_repeat = repeat[1]; - } - else if (property == prop_buttonscroll_time) { - if (!priv->has_scrollbuttons) - return BadMatch; - - if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER) - return BadMatch; - - para->scroll_button_repeat = *(INT32 *) prop->data; - - } else if (property == prop_off) { CARD8 off; diff --git a/src/synaptics.c b/src/synaptics.c index 64da2c6..36f534d 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -661,19 +661,6 @@ set_default_parameters(InputInfoPtr pInfo) xf86SetBoolOption(opts, "VertTwoFingerScroll", vertTwoFingerScroll); pars->scroll_twofinger_horiz = xf86SetBoolOption(opts, "HorizTwoFingerScroll", horizTwoFingerScroll); - - if (priv->has_scrollbuttons) { - pars->updown_button_scrolling = - xf86SetBoolOption(opts, "UpDownScrolling", TRUE); - pars->leftright_button_scrolling = - xf86SetBoolOption(opts, "LeftRightScrolling", TRUE); - pars->updown_button_repeat = - xf86SetBoolOption(opts, "UpDownScrollRepeat", TRUE); - pars->leftright_button_repeat = - xf86SetBoolOption(opts, "LeftRightScrollRepeat", TRUE); - } - pars->scroll_button_repeat = - xf86SetIntOption(opts, "ScrollButtonRepeat", 100); pars->touchpad_off = xf86SetIntOption(opts, "TouchpadOff", 0); pars->locked_drags = xf86SetBoolOption(opts, "LockedDrags", FALSE); pars->locked_drag_time = xf86SetIntOption(opts, "LockedDragTimeout", 5000); @@ -876,8 +863,6 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) xf86ErrorFVerb(6, "port opened successfully\n"); /* initialize variables */ - priv->repeatButtons = 0; - priv->nextRepeat = 0; priv->count_packet_finger = 0; priv->tap_state = TS_START; priv->tap_button = 0; @@ -1056,7 +1041,6 @@ SynapticsReset(SynapticsPrivate * priv) priv->circ_scroll_on = FALSE; priv->circ_scroll_vert = FALSE; priv->mid_emu_state = MBE_OFF; - priv->nextRepeat = 0; priv->lastButtons = 0; priv->prev_z = 0; priv->prevFingers = 0; @@ -2684,46 +2668,6 @@ handle_clickfinger(SynapticsPrivate * priv, struct SynapticsHwState *hw) } } -/* Adjust the hardware state according to the extra buttons (if the touchpad - * has any and not many touchpads do these days). These buttons are up/down - * tilt buttons and/or left/right buttons that then map into a specific - * function (or scrolling into). - */ -static Bool -adjust_state_from_scrollbuttons(const InputInfoPtr pInfo, - struct SynapticsHwState *hw) -{ - SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); - SynapticsParameters *para = &priv->synpara; - Bool double_click = FALSE; - - if (!para->updown_button_scrolling) { - if (hw->down) { /* map down button to middle button */ - hw->middle = TRUE; - } - - if (hw->up) { /* up button generates double click */ - if (!priv->prev_up) - double_click = TRUE; - } - priv->prev_up = hw->up; - - /* reset up/down button events */ - hw->up = hw->down = FALSE; - } - - /* Left/right button scrolling, or middle clicks */ - if (!para->leftright_button_scrolling) { - if (hw->multi[2] || hw->multi[3]) - hw->middle = TRUE; - - /* reset left/right button events */ - hw->multi[2] = hw->multi[3] = FALSE; - } - - return double_click; -} - static void update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, struct SynapticsHwState *old, CARD32 now, int *delay) @@ -2820,66 +2764,6 @@ post_scroll_events(const InputInfoPtr pInfo) #endif } -static inline int -repeat_scrollbuttons(const InputInfoPtr pInfo, - const struct SynapticsHwState *hw, - int buttons, CARD32 now, int delay) -{ - SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); - SynapticsParameters *para = &priv->synpara; - int repeat_delay, timeleft; - int rep_buttons = 0; - - if (para->updown_button_repeat) - rep_buttons |= (1 << (4 - 1)) | (1 << (5 - 1)); - if (para->leftright_button_repeat) - rep_buttons |= (1 << (6 - 1)) | (1 << (7 - 1)); - - /* Handle auto repeat buttons */ - repeat_delay = clamp(para->scroll_button_repeat, SBR_MIN, SBR_MAX); - if (((hw->up || hw->down) && para->updown_button_repeat && - para->updown_button_scrolling) || - ((hw->multi[2] || hw->multi[3]) && para->leftright_button_repeat && - para->leftright_button_scrolling)) { - priv->repeatButtons = buttons & rep_buttons; - if (!priv->nextRepeat) { - priv->nextRepeat = now + repeat_delay * 2; - } - } - else { - priv->repeatButtons = 0; - priv->nextRepeat = 0; - } - - if (priv->repeatButtons) { - timeleft = TIME_DIFF(priv->nextRepeat, now); - if (timeleft > 0) - delay = MIN(delay, timeleft); - if (timeleft <= 0) { - int change, id; - - change = priv->repeatButtons; - while (change) { - id = ffs(change); - change &= ~(1 << (id - 1)); - if (id == 4) - priv->scroll.delta_y -= para->scroll_dist_vert; - else if (id == 5) - priv->scroll.delta_y += para->scroll_dist_vert; - else if (id == 6) - priv->scroll.delta_x -= para->scroll_dist_horiz; - else if (id == 7) - priv->scroll.delta_x += para->scroll_dist_horiz; - } - - priv->nextRepeat = now + repeat_delay; - delay = MIN(delay, repeat_delay); - } - } - - return delay; -} - /* Update the open slots and number of active touches */ static void UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw) @@ -3075,8 +2959,6 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, /* these two just update hw->left, right, etc. */ update_hw_button_state(pInfo, hw, priv->old_hw_state, now, &delay); - if (priv->has_scrollbuttons) - double_click = adjust_state_from_scrollbuttons(pInfo, hw); /* no edge or finger detection outside of area */ if (inside_active_area) { @@ -3163,9 +3045,6 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, 0, 0); } - if (priv->has_scrollbuttons) - delay = repeat_scrollbuttons(pInfo, hw, buttons, now, delay); - /* Process scroll events only if coordinates are * in the Synaptics Area */ diff --git a/src/synapticsstr.h b/src/synapticsstr.h index 5e85a3b..d894b63 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -138,12 +138,6 @@ typedef struct _SynapticsParameters { Bool scroll_twofinger_horiz; /* Enable/disable horizontal two-finger scrolling */ double min_speed, max_speed, accl; /* movement parameters */ - Bool updown_button_scrolling; /* Up/Down-Button scrolling or middle/double-click */ - Bool leftright_button_scrolling; /* Left/right-button scrolling, or two lots of middle button */ - Bool updown_button_repeat; /* If up/down button being used to scroll, auto-repeat? */ - Bool leftright_button_repeat; /* If left/right button being used to scroll, auto-repeat? */ - int scroll_button_repeat; /* time, in milliseconds, between scroll events being - * sent when holding down scroll buttons */ int touchpad_off; /* Switches the touchpad off * 0 : Not off * 1 : Off @@ -186,7 +180,7 @@ struct _SynapticsPrivateRec { const char *device; /* device node */ CARD32 timer_time; /* when timer last fired */ - OsTimerPtr timer; /* for up/down-button repeat, tap processing, etc */ + OsTimerPtr timer; /* for tap processing, etc */ struct CommData comm; @@ -232,8 +226,6 @@ struct _SynapticsPrivateRec { False: Generate horizontal events */ double frac_x, frac_y; /* absolute -> relative fraction */ enum MidButtonEmulation mid_emu_state; /* emulated 3rd button */ - int repeatButtons; /* buttons for repeat */ - int nextRepeat; /* Time when to trigger next auto repeat event */ int lastButtons; /* last state of the buttons */ int prev_z; /* previous z value, for palm detection */ int prevFingers; /* previous numFingers, for transition detection */ |