Misplaced scanf caused button mappings to always be 0 if no + or - was specified or the button number was < 10.
Signed-off-by: Peter Hutterer <[email protected]> --- tools/xsetwacom.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index affa08f..767850c 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -1277,9 +1277,6 @@ static int special_map_button(int argc, char **argv, unsigned long *ndata, unsig if (is_valid_keyword(btn)) break; - if (sscanf(btn, "%d", &button) != 1) - return nitems; - switch (btn[0]) { case '+': need_press = 1; break; @@ -1291,6 +1288,10 @@ static int special_map_button(int argc, char **argv, unsigned long *ndata, unsig } else need_press = need_release = 1; + if (sscanf(btn, "%d", &button) != 1) + return nitems; + TRACE("Button map %d [%s,%s]\n", abs(button), need_press ? "press" : "", need_release ? "release" : ""); -- 1.7.1 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
