diff options
author | Daniel Stone <daniel@fooishbar.org> | 2011-06-09 20:03:08 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-25 09:50:34 +1000 |
commit | 81a8ddb4a768bee3a4b304716fa4cfead49a2761 (patch) | |
tree | 9420f6cd5191b1ed49bc6e1e37f5088a9530031b | |
parent | f40bbf7494a6122d464e3fff4309f69af2a20e4a (diff) |
Scroll: Clarify rep_buttons assignment
Instead of a combined variable declaration with two ternary expressions
using raw hex values, expand it to have two genuine if statements,
setting with a more clear bitshift.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/synaptics.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index d7e13f0..9e0470e 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2445,8 +2445,12 @@ repeat_scrollbuttons(const InputInfoPtr pInfo, SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); SynapticsParameters *para = &priv->synpara; int repeat_delay, timeleft; - int rep_buttons = ((para->updown_button_repeat ? 0x18 : 0) | - (para->leftright_button_repeat ? 0x60 : 0)); + 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); |