@@ -22,44 +22,47 @@ def __init__(self, pin_num, active_low=True, pullup_active=True) -> None:
22
22
self .CB_TYPE = CB_TYPE ()
23
23
24
24
def isHolding (self ):
25
- return super () .last_state == super () .current_state and super () .last_state == super () .HOLD
25
+ return self .last_state == self .current_state and self .last_state == self .HOLD
26
26
27
27
def isPressed (self ):
28
28
return (
29
- super () .last_state == super () .current_state and super () .last_state == super () .PRESSED
29
+ self .last_state == self .current_state and self .last_state == self .PRESSED
30
30
)
31
31
32
32
def isReleased (self ):
33
33
return (
34
- super () .last_state == super () .current_state and super () .last_state == super () .RELEASED
34
+ self .last_state == self .current_state and self .last_state == self .RELEASED
35
35
)
36
36
37
+ def isClicked (self ):
38
+ return self .last_state == self .current_state and self .last_state == self .CLICKED
39
+
37
40
def wasHold (self ):
38
- return super () .last_state == super () .HOLD
41
+ return self .last_state == self .HOLD
39
42
40
43
def wasPressed (self ):
41
- return super () .last_state == super () .PRESSED
44
+ return self .last_state == self .PRESSED
42
45
43
46
def wasReleased (self ):
44
- return super () .last_state == super () .RELEASED
47
+ return self .last_state == self .RELEASED
45
48
46
49
def wasClicked (self ):
47
- return super () .last_state == super () .CLICKED
50
+ return self .last_state == self .CLICKED
48
51
49
52
def wasSingleClicked (self ):
50
- return super () .last_state == super () .CLICKED
53
+ return self .last_state == self .CLICKED
51
54
52
55
def wasDoubleClicked (self ):
53
- return super () .last_state == super () .DOUBLE_CLICKED
56
+ return self .last_state == self .DOUBLE_CLICKED
54
57
55
58
def setCallback (self , type = None , cb = None ):
56
59
if type == 0 :
57
- super () .attach_click_event (cb , parameter = self .WAS_CLICKED )
60
+ self .attach_click_event (cb , parameter = self .WAS_CLICKED )
58
61
elif type == 1 :
59
- super () .attach_double_click (cb , parameter = self .WAS_DOUBLECLICKED )
62
+ self .attach_double_click (cb , parameter = self .WAS_DOUBLECLICKED )
60
63
elif type == 2 :
61
- super () .attach_during_long_press (cb , parameter = self .WAS_HOLD )
64
+ self .attach_during_long_press (cb , parameter = self .WAS_HOLD )
62
65
elif type == 3 :
63
- super () .attach_long_press_start (cb , parameter = self .WAS_PRESSED )
66
+ self .attach_long_press_start (cb , parameter = self .WAS_PRESSED )
64
67
elif type == 4 :
65
- super () .attach_long_press_stop (cb , parameter = self .WAS_RELEASED )
68
+ self .attach_long_press_stop (cb , parameter = self .WAS_RELEASED )
0 commit comments