diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-01-31 09:27:19 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-01-31 09:27:19 +1000 |
commit | 4cdee40054b2d6e222a7efb427f0f35479c04ec3 (patch) | |
tree | 20c2f24a17f83a24120e4475964f3822fc61aaf3 | |
parent | 2159b5d26207c83efea6efca7fa5765df95a4219 (diff) |
Replace numerical values with an enum for the TouchpadOff prop
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/synaptics.c | 8 | ||||
-rw-r--r-- | src/synapticsstr.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 29e551a..df092c0 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -650,7 +650,7 @@ set_default_parameters(InputInfoPtr pInfo) xf86SetBoolOption(opts, "VertTwoFingerScroll", vertTwoFingerScroll); pars->scroll_twofinger_horiz = xf86SetBoolOption(opts, "HorizTwoFingerScroll", horizTwoFingerScroll); - pars->touchpad_off = xf86SetIntOption(opts, "TouchpadOff", 0); + pars->touchpad_off = xf86SetIntOption(opts, "TouchpadOff", TOUCHPAD_ON); pars->locked_drags = xf86SetBoolOption(opts, "LockedDrags", FALSE); pars->locked_drag_time = xf86SetIntOption(opts, "LockedDragTimeout", 5000); pars->tap_action[RT_TAP] = xf86SetIntOption(opts, "RTCornerButton", 0); @@ -1629,7 +1629,7 @@ SelectTapButton(SynapticsPrivate * priv, enum EdgeType edge) { enum TapEvent tap; - if (priv->synpara.touchpad_off == 2) { + if (priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF) { priv->tap_button = 0; return; } @@ -2171,7 +2171,7 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw, SynapticsParameters *para = &priv->synpara; int delay = 1000000000; - if ((priv->synpara.touchpad_off == 2) || (priv->finger_state == FS_BLOCKED)) { + if ((priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF) || (priv->finger_state == FS_BLOCKED)) { stop_coasting(priv); priv->circ_scroll_on = FALSE; priv->vert_scroll_edge_on = FALSE; @@ -2763,7 +2763,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, Bool inside_active_area; /* If touchpad is switched off, we skip the whole thing and return delay */ - if (para->touchpad_off == 1) { + if (para->touchpad_off == TOUCHPAD_OFF) { UpdateTouchState(pInfo, hw); return delay; } diff --git a/src/synapticsstr.h b/src/synapticsstr.h index f6cbb4a..428befa 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -47,6 +47,12 @@ #define SYNAPTICS_MAX_TOUCHES 10 #define SYN_MAX_BUTTONS 12 /* Max number of mouse buttons */ +enum OffState { + TOUCHPAD_ON = 0, + TOUCHPAD_OFF = 1, + TOUCHPAD_TAP_OFF = 2, +}; + enum TapEvent { RT_TAP = 0, /* Right top corner */ RB_TAP, /* Right bottom corner */ |