47 } |
47 } |
48 |
48 |
49 static const std::wstring OPTION_FREQUENCY; |
49 static const std::wstring OPTION_FREQUENCY; |
50 static const std::wstring OPTION_SMART_SCROLLING; |
50 static const std::wstring OPTION_SMART_SCROLLING; |
51 static const std::wstring OPTION_LIFT_OFF_DETECTION; |
51 static const std::wstring OPTION_LIFT_OFF_DETECTION; |
|
52 static const std::wstring OPTION_REMAP_WHEEL_PRESS; |
|
53 static const std::wstring OPTION_REMAP_GESTURE_BUTTON; |
52 static const std::wstring OPTION_DAEMON; |
54 static const std::wstring OPTION_DAEMON; |
53 |
55 |
54 CLIConfiguration parse(const std::vector<std::wstring>& arguments) { |
56 CLIConfiguration parse(const std::vector<std::wstring>& arguments) { |
55 CLIConfiguration c; |
57 CLIConfiguration c; |
56 |
58 |
61 c.cadMouseConfig.setFrequency(parseFrequency(readNext(arguments, i))); |
63 c.cadMouseConfig.setFrequency(parseFrequency(readNext(arguments, i))); |
62 } else if (option == OPTION_SMART_SCROLLING) { |
64 } else if (option == OPTION_SMART_SCROLLING) { |
63 c.cadMouseConfig.setSmartScrolling(parseBoolean(readNext(arguments, i))); |
65 c.cadMouseConfig.setSmartScrolling(parseBoolean(readNext(arguments, i))); |
64 } else if (option == OPTION_LIFT_OFF_DETECTION) { |
66 } else if (option == OPTION_LIFT_OFF_DETECTION) { |
65 c.cadMouseConfig.setLiftOffDetection(parseBoolean(readNext(arguments, i))); |
67 c.cadMouseConfig.setLiftOffDetection(parseBoolean(readNext(arguments, i))); |
|
68 } else if (option == OPTION_REMAP_WHEEL_PRESS) { |
|
69 c.cadMouseConfig.setWheelPressRemapped(parseBoolean(readNext(arguments, i))); |
|
70 } else if (option == OPTION_REMAP_GESTURE_BUTTON) { |
|
71 c.cadMouseConfig.setRemapGestureButton(parseBoolean(readNext(arguments, i))); |
66 } else if (option == OPTION_DAEMON) { |
72 } else if (option == OPTION_DAEMON) { |
67 c.daemon = parseBoolean(readNext(arguments, i)); |
73 c.daemon = parseBoolean(readNext(arguments, i)); |
68 } else throw CLIException(L"Unsupported CLI option: " + option, CLI::EXIT_CODE_BAD_CLI_ARGUMENTS); |
74 } else throw CLIException(L"Unsupported CLI option: " + option, CLI::EXIT_CODE_BAD_CLI_ARGUMENTS); |
69 } |
75 } |
70 |
76 |
77 |
83 |
78 |
84 |
79 const std::wstring CLIParser::OPTION_FREQUENCY = L"--frequency"; |
85 const std::wstring CLIParser::OPTION_FREQUENCY = L"--frequency"; |
80 const std::wstring CLIParser::OPTION_SMART_SCROLLING = L"--smart-scrolling"; |
86 const std::wstring CLIParser::OPTION_SMART_SCROLLING = L"--smart-scrolling"; |
81 const std::wstring CLIParser::OPTION_LIFT_OFF_DETECTION = L"--lift-off-detection"; |
87 const std::wstring CLIParser::OPTION_LIFT_OFF_DETECTION = L"--lift-off-detection"; |
|
88 const std::wstring CLIParser::OPTION_REMAP_WHEEL_PRESS = L"--remap-wheel-press"; |
|
89 const std::wstring CLIParser::OPTION_REMAP_GESTURE_BUTTON = L"--remap-gesture-button"; |
82 const std::wstring CLIParser::OPTION_DAEMON = L"--daemon"; |
90 const std::wstring CLIParser::OPTION_DAEMON = L"--daemon"; |