added side-scrolling toggle setting

This commit is contained in:
Daniel Pavel 2013-07-18 20:35:39 +02:00
parent c35ae8ffc9
commit 2829acd6f5
2 changed files with 28 additions and 0 deletions

View File

@ -177,6 +177,9 @@ _D('Wireless Mouse M215', protocol=1.0, wpid='1020')
_D('Wireless Mouse M235')
_D('Wireless Mouse M305', protocol=1.0, wpid='101F',
registers=(_R.battery_status, ),
settings=[
_RS.side_scroll(),
],
)
_D('Wireless Mouse M310')
_D('Wireless Mouse M315')
@ -185,11 +188,16 @@ _D('Wireless Mouse M325')
_D('Wireless Mouse M345', protocol=2.0, wpid='4017')
_D('Wireless Mouse M505', codename='M505/B605', protocol=1.0, wpid='101D',
registers=(_R.battery_charge, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
_D('Wireless Mouse M510', protocol=1.0, wpid='1025',
registers=(_R.battery_status, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
_D('Couch Mouse M515', protocol=2.0, wpid='4007')
@ -199,6 +207,7 @@ _D('Marathon Mouse M705', protocol=1.0, wpid='101B',
registers=(_R.battery_charge, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
_D('Zone Touch Mouse T400')
@ -206,11 +215,17 @@ _D('Touch Mouse T620', protocol=2.0)
_D('Logitech Cube', kind=_hidpp10.DEVICE_KIND.mouse, protocol=2.0)
_D('Anywhere Mouse MX', codename='Anywhere MX', protocol=1.0, wpid='1017',
registers=(_R.battery_charge, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
_D('Performance Mouse MX', codename='Performance MX', protocol=1.0, wpid='101A',
registers=(_R.battery_status, _R.three_leds, ),
settings=[
_RS.dpi(choices=_PERFORMANCE_MX_DPIS),
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
@ -232,6 +247,7 @@ _D('VX Nano Cordless Laser Mouse', codename='VX Nano', protocol=1.0, wpid='100F'
registers=(_R.battery_charge, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)
_D('V450 Nano Cordless Laser Mouse', codename='V450 Nano', protocol=1.0, wpid='1011',
@ -241,5 +257,6 @@ _D('V550 Nano Cordless Laser Mouse', codename='V550 Nano', protocol=1.0, wpid='1
registers=(_R.battery_charge, ),
settings=[
_RS.smooth_scroll(),
_RS.side_scroll(),
],
)

View File

@ -76,6 +76,9 @@ def feature_toggle(name, feature,
_SMOOTH_SCROLL = ('smooth-scroll', _("Smooth Scrolling"),
_("High-sensitivity mode for vertical scroll with the wheel."))
_SIDE_SCROLL = ('side-scroll', _("Side Scrolling"),
_("When disabled, pushing the wheel sideways sends custom button events\n"
"instead of the standard side-scrolling events."))
_DPI = ('dpi', _("Sensitivity (DPI)"), None)
_FN_SWAP = ('fn-swap', _("Swap Fx function"),
_("When set, the F1..F12 keys will activate their special function,\n"
@ -98,6 +101,11 @@ def _register_smooth_scroll(register=_R.mouse_button_flags, true_value=0x40, mas
label=_SMOOTH_SCROLL[1], description=_SMOOTH_SCROLL[2],
device_kind=_DK.mouse)
def _register_side_scroll(register=_R.mouse_button_flags, true_value=0x02, mask=0x02):
return register_toggle(_SIDE_SCROLL[0], register, true_value=true_value, mask=mask,
label=_SIDE_SCROLL[1], description=_SIDE_SCROLL[2],
device_kind=_DK.mouse)
def _register_dpi(register=_R.mouse_dpi, choices=None):
return register_choices(_DPI[0], register, choices,
label=_DPI[1], description=_DPI[2],
@ -118,6 +126,7 @@ from collections import namedtuple
_SETTINGS_LIST = namedtuple('_SETTINGS_LIST', [
'fn_swap',
'smooth_scroll',
'side_scroll',
'dpi',
'hand_detection',
'typing_illumination',
@ -127,6 +136,7 @@ del namedtuple
RegisterSettings = _SETTINGS_LIST(
fn_swap=_register_fn_swap,
smooth_scroll=_register_smooth_scroll,
side_scroll=_register_side_scroll,
dpi=_register_dpi,
hand_detection=None,
typing_illumination=None,
@ -134,6 +144,7 @@ RegisterSettings = _SETTINGS_LIST(
FeatureSettings = _SETTINGS_LIST(
fn_swap=_feature_fn_swap,
smooth_scroll=None,
side_scroll=None,
dpi=None,
hand_detection=None,
typing_illumination=None,