38
38
from . import settings
39
39
from . import special_keys
40
40
from .hidpp10_constants import Registers
41
+ from .hidpp20_constants import GestureId
41
42
from .hidpp20_constants import ParamId
42
43
43
44
logger = logging .getLogger (__name__ )
46
47
_DK = hidpp10_constants .DEVICE_KIND
47
48
_F = hidpp20_constants .SupportedFeature
48
49
49
- _GG = hidpp20_constants .GESTURE
50
-
51
50
52
51
class State (enum .Enum ):
53
52
IDLE = "idle"
@@ -1227,72 +1226,72 @@ def build(cls, setting_class, device):
1227
1226
1228
1227
1229
1228
_GESTURE2_GESTURES_LABELS = {
1230
- _GG [ "Tap1Finger" ] : (_ ("Single tap" ), _ ("Performs a left click." )),
1231
- _GG [ "Tap2Finger" ] : (_ ("Single tap with two fingers" ), _ ("Performs a right click." )),
1232
- _GG [ "Tap3Finger" ] : (_ ("Single tap with three fingers" ), None ),
1233
- _GG [ "Click1Finger" ] : (None , None ),
1234
- _GG [ "Click2Finger" ] : (None , None ),
1235
- _GG [ "Click3Finger" ] : (None , None ),
1236
- _GG [ "DoubleTap1Finger" ] : (_ ("Double tap" ), _ ("Performs a double click." )),
1237
- _GG [ "DoubleTap2Finger" ] : (_ ("Double tap with two fingers" ), None ),
1238
- _GG [ "DoubleTap3Finger" ] : (_ ("Double tap with three fingers" ), None ),
1239
- _GG [ "Track1Finger" ] : (None , None ),
1240
- _GG [ "TrackingAcceleration" ] : (None , None ),
1241
- _GG [ "TapDrag1Finger" ] : (_ ("Tap and drag" ), _ ("Drags items by dragging the finger after double tapping." )),
1242
- _GG [ "TapDrag2Finger" ] : (
1229
+ GestureId . TAP_1_FINGER : (_ ("Single tap" ), _ ("Performs a left click." )),
1230
+ GestureId . TAP_2_FINGER : (_ ("Single tap with two fingers" ), _ ("Performs a right click." )),
1231
+ GestureId . TAP_3_FINGER : (_ ("Single tap with three fingers" ), None ),
1232
+ GestureId . CLICK_1_FINGER : (None , None ),
1233
+ GestureId . CLICK_2_FINGER : (None , None ),
1234
+ GestureId . CLICK_3_FINGER : (None , None ),
1235
+ GestureId . DOUBLE_TAP_1_FINGER : (_ ("Double tap" ), _ ("Performs a double click." )),
1236
+ GestureId . DOUBLE_TAP_2_FINGER : (_ ("Double tap with two fingers" ), None ),
1237
+ GestureId . DOUBLE_TAP_3_FINGER : (_ ("Double tap with three fingers" ), None ),
1238
+ GestureId . TRACK_1_FINGER : (None , None ),
1239
+ GestureId . TRACKING_ACCELERATION : (None , None ),
1240
+ GestureId . TAP_DRAG_1_FINGER : (_ ("Tap and drag" ), _ ("Drags items by dragging the finger after double tapping." )),
1241
+ GestureId . TAP_DRAG_2_FINGER : (
1243
1242
_ ("Tap and drag with two fingers" ),
1244
1243
_ ("Drags items by dragging the fingers after double tapping." ),
1245
1244
),
1246
- _GG [ "Drag3Finger" ] : (_ ("Tap and drag with three fingers" ), None ),
1247
- _GG [ "TapGestures" ] : (None , None ),
1248
- _GG [ "FnClickGestureSuppression" ] : (
1245
+ GestureId . DRAG_3_FINGER : (_ ("Tap and drag with three fingers" ), None ),
1246
+ GestureId . TAP_GESTURES : (None , None ),
1247
+ GestureId . FN_CLICK_GESTURE_SUPPRESSION : (
1249
1248
_ ("Suppress tap and edge gestures" ),
1250
1249
_ ("Disables tap and edge gestures (equivalent to pressing Fn+LeftClick)." ),
1251
1250
),
1252
- _GG [ "Scroll1Finger" ] : (_ ("Scroll with one finger" ), _ ("Scrolls." )),
1253
- _GG [ "Scroll2Finger" ] : (_ ("Scroll with two fingers" ), _ ("Scrolls." )),
1254
- _GG [ "Scroll2FingerHoriz" ] : (_ ("Scroll horizontally with two fingers" ), _ ("Scrolls horizontally." )),
1255
- _GG [ "Scroll2FingerVert" ] : (_ ("Scroll vertically with two fingers" ), _ ("Scrolls vertically." )),
1256
- _GG [ "Scroll2FingerStateless" ] : (_ ("Scroll with two fingers" ), _ ("Scrolls." )),
1257
- _GG [ "NaturalScrolling" ] : (_ ("Natural scrolling" ), _ ("Inverts the scrolling direction." )),
1258
- _GG [ "Thumbwheel" ] : (_ ("Thumbwheel" ), _ ("Enables the thumbwheel." )),
1259
- _GG [ "VScrollInertia" ] : (None , None ),
1260
- _GG [ "VScrollBallistics" ] : (None , None ),
1261
- _GG [ "Swipe2FingerHoriz" ] : (None , None ),
1262
- _GG [ "Swipe3FingerHoriz" ] : (None , None ),
1263
- _GG [ "Swipe4FingerHoriz" ] : (None , None ),
1264
- _GG [ "Swipe3FingerVert" ] : (None , None ),
1265
- _GG [ "Swipe4FingerVert" ] : (None , None ),
1266
- _GG [ "LeftEdgeSwipe1Finger" ] : (None , None ),
1267
- _GG [ "RightEdgeSwipe1Finger" ] : (None , None ),
1268
- _GG [ "BottomEdgeSwipe1Finger" ] : (None , None ),
1269
- _GG [ "TopEdgeSwipe1Finger" ] : (_ ("Swipe from the top edge" ), None ),
1270
- _GG [ "LeftEdgeSwipe1Finger2" ] : (_ ("Swipe from the left edge" ), None ),
1271
- _GG [ "RightEdgeSwipe1Finger2" ] : (_ ("Swipe from the right edge" ), None ),
1272
- _GG [ "BottomEdgeSwipe1Finger2" ] : (_ ("Swipe from the bottom edge" ), None ),
1273
- _GG [ "TopEdgeSwipe1Finger2" ] : (_ ("Swipe from the top edge" ), None ),
1274
- _GG [ "LeftEdgeSwipe2Finger" ] : (_ ("Swipe two fingers from the left edge" ), None ),
1275
- _GG [ "RightEdgeSwipe2Finger" ] : (_ ("Swipe two fingers from the right edge" ), None ),
1276
- _GG [ "BottomEdgeSwipe2Finger" ] : (_ ("Swipe two fingers from the bottom edge" ), None ),
1277
- _GG [ "TopEdgeSwipe2Finger" ] : (_ ("Swipe two fingers from the top edge" ), None ),
1278
- _GG [ "Zoom2Finger" ] : (_ ("Zoom with two fingers." ), _ ("Pinch to zoom out; spread to zoom in." )),
1279
- _GG [ "Zoom2FingerPinch" ] : (_ ("Pinch to zoom out." ), _ ("Pinch to zoom out." )),
1280
- _GG [ "Zoom2FingerSpread" ] : (_ ("Spread to zoom in." ), _ ("Spread to zoom in." )),
1281
- _GG [ "Zoom3Finger" ] : (_ ("Zoom with three fingers." ), None ),
1282
- _GG [ "Zoom2FingerStateless" ] : (_ ("Zoom with two fingers" ), _ ("Pinch to zoom out; spread to zoom in." )),
1283
- _GG [ "TwoFingersPresent" ] : (None , None ),
1284
- _GG [ "Rotate2Finger" ] : (None , None ),
1285
- _GG [ "Finger1" ] : (None , None ),
1286
- _GG [ "Finger2" ] : (None , None ),
1287
- _GG [ "Finger3" ] : (None , None ),
1288
- _GG [ "Finger4" ] : (None , None ),
1289
- _GG [ "Finger5" ] : (None , None ),
1290
- _GG [ "Finger6" ] : (None , None ),
1291
- _GG [ "Finger7" ] : (None , None ),
1292
- _GG [ "Finger8" ] : (None , None ),
1293
- _GG [ "Finger9" ] : (None , None ),
1294
- _GG [ "Finger10" ] : (None , None ),
1295
- _GG [ "DeviceSpecificRawData" ] : (None , None ),
1251
+ GestureId . SCROLL_1_FINGER : (_ ("Scroll with one finger" ), _ ("Scrolls." )),
1252
+ GestureId . SCROLL_2_FINGER : (_ ("Scroll with two fingers" ), _ ("Scrolls." )),
1253
+ GestureId . SCROLL_2_FINGER_HORIZONTAL : (_ ("Scroll horizontally with two fingers" ), _ ("Scrolls horizontally." )),
1254
+ GestureId . SCROLL_2_FINGER_VERTICAL : (_ ("Scroll vertically with two fingers" ), _ ("Scrolls vertically." )),
1255
+ GestureId . SCROLL_2_FINGER_STATELESS : (_ ("Scroll with two fingers" ), _ ("Scrolls." )),
1256
+ GestureId . NATURAL_SCROLLING : (_ ("Natural scrolling" ), _ ("Inverts the scrolling direction." )),
1257
+ GestureId . THUMBWHEEL : (_ ("Thumbwheel" ), _ ("Enables the thumbwheel." )),
1258
+ GestureId . V_SCROLL_INTERTIA : (None , None ),
1259
+ GestureId . V_SCROLL_BALLISTICS : (None , None ),
1260
+ GestureId . SWIPE_2_FINGER_HORIZONTAL : (None , None ),
1261
+ GestureId . SWIPE_3_FINGER_HORIZONTAL : (None , None ),
1262
+ GestureId . SWIPE_4_FINGER_HORIZONTAL : (None , None ),
1263
+ GestureId . SWIPE_3_FINGER_VERTICAL : (None , None ),
1264
+ GestureId . SWIPE_4_FINGER_VERTICAL : (None , None ),
1265
+ GestureId . LEFT_EDGE_SWIPE_1_FINGER : (None , None ),
1266
+ GestureId . RIGHT_EDGE_SWIPE_1_FINGER : (None , None ),
1267
+ GestureId . BOTTOM_EDGE_SWIPE_1_FINGER : (None , None ),
1268
+ GestureId . TOP_EDGE_SWIPE_1_FINGER : (_ ("Swipe from the top edge" ), None ),
1269
+ GestureId . LEFT_EDGE_SWIPE_1_FINGER_2 : (_ ("Swipe from the left edge" ), None ),
1270
+ GestureId . RIGHT_EDGE_SWIPE_1_FINGER_2 : (_ ("Swipe from the right edge" ), None ),
1271
+ GestureId . BOTTOM_EDGE_SWIPE_1_FINGER_2 : (_ ("Swipe from the bottom edge" ), None ),
1272
+ GestureId . TOP_EDGE_SWIPE_1_FINGER_2 : (_ ("Swipe from the top edge" ), None ),
1273
+ GestureId . LEFT_EDGE_SWIPE_2_FINGER : (_ ("Swipe two fingers from the left edge" ), None ),
1274
+ GestureId . RIGHT_EDGE_SWIPE_2_FINGER : (_ ("Swipe two fingers from the right edge" ), None ),
1275
+ GestureId . BOTTOM_EDGE_SWIPE_2_FINGER : (_ ("Swipe two fingers from the bottom edge" ), None ),
1276
+ GestureId . TOP_EDGE_SWIPE_2_FINGER : (_ ("Swipe two fingers from the top edge" ), None ),
1277
+ GestureId . ZOOM_2_FINGER : (_ ("Zoom with two fingers." ), _ ("Pinch to zoom out; spread to zoom in." )),
1278
+ GestureId . ZOOM_2_FINGER_PINCH : (_ ("Pinch to zoom out." ), _ ("Pinch to zoom out." )),
1279
+ GestureId . ZOOM_2_FINGER_SPREAD : (_ ("Spread to zoom in." ), _ ("Spread to zoom in." )),
1280
+ GestureId . ZOOM_3_FINGER : (_ ("Zoom with three fingers." ), None ),
1281
+ GestureId . ZOOM_2_FINGER_STATELESS : (_ ("Zoom with two fingers" ), _ ("Pinch to zoom out; spread to zoom in." )),
1282
+ GestureId . TWO_FINGERS_PRESENT : (None , None ),
1283
+ GestureId . ROTATE_2_FINGER : (None , None ),
1284
+ GestureId . FINGER_1 : (None , None ),
1285
+ GestureId . FINGER_2 : (None , None ),
1286
+ GestureId . FINGER_3 : (None , None ),
1287
+ GestureId . FINGER_4 : (None , None ),
1288
+ GestureId . FINGER_5 : (None , None ),
1289
+ GestureId . FINGER_6 : (None , None ),
1290
+ GestureId . FINGER_7 : (None , None ),
1291
+ GestureId . FINGER_8 : (None , None ),
1292
+ GestureId . FINGER_9 : (None , None ),
1293
+ GestureId . FINGER_10 : (None , None ),
1294
+ GestureId . DEVICE_SPECIFIC_RAW_DATA : (None , None ),
1296
1295
}
1297
1296
1298
1297
_GESTURE2_PARAMS_LABELS = {
@@ -1318,7 +1317,7 @@ class Gesture2Gestures(settings.BitFieldWithOffsetAndMaskSetting):
1318
1317
feature = _F .GESTURE_2
1319
1318
rw_options = {"read_fnid" : 0x10 , "write_fnid" : 0x20 }
1320
1319
validator_options = {"om_method" : hidpp20 .Gesture .enable_offset_mask }
1321
- choices_universe = hidpp20_constants .GESTURE
1320
+ choices_universe = hidpp20_constants .GestureId
1322
1321
_labels = _GESTURE2_GESTURES_LABELS
1323
1322
1324
1323
class validator_class (settings .BitFieldWithOffsetAndMaskValidator ):
@@ -1335,7 +1334,7 @@ class Gesture2Divert(settings.BitFieldWithOffsetAndMaskSetting):
1335
1334
feature = _F .GESTURE_2
1336
1335
rw_options = {"read_fnid" : 0x30 , "write_fnid" : 0x40 }
1337
1336
validator_options = {"om_method" : hidpp20 .Gesture .diversion_offset_mask }
1338
- choices_universe = hidpp20_constants .GESTURE
1337
+ choices_universe = hidpp20_constants .GestureId
1339
1338
_labels = _GESTURE2_GESTURES_LABELS
1340
1339
1341
1340
class validator_class (settings .BitFieldWithOffsetAndMaskValidator ):
0 commit comments