|
22 | 22 |
|
23 | 23 |
|
24 | 24 | class KeyInput(InputDevice): |
25 | | - def __init__(self, name): |
| 25 | + def __init__(self, name) -> None: |
26 | 26 | super(KeyInput, self).__init__() |
27 | 27 | self.name = name |
28 | 28 | self.type = interaction.KEY |
29 | 29 |
|
30 | | - def encode(self): |
| 30 | + def encode(self) -> dict: |
31 | 31 | return {"type": self.type, "id": self.name, "actions": [acts.encode() for acts in self.actions]} |
32 | 32 |
|
33 | | - def create_key_down(self, key): |
| 33 | + def create_key_down(self, key) -> None: |
34 | 34 | self.add_action(TypingInteraction(self, "keyDown", key)) |
35 | 35 |
|
36 | | - def create_key_up(self, key): |
| 36 | + def create_key_up(self, key) -> None: |
37 | 37 | self.add_action(TypingInteraction(self, "keyUp", key)) |
38 | 38 |
|
39 | | - def create_pause(self, pause_duration=0): |
| 39 | + def create_pause(self, pause_duration=0) -> None: |
40 | 40 | self.add_action(Pause(self, pause_duration)) |
41 | 41 |
|
42 | 42 |
|
43 | 43 | class TypingInteraction(Interaction): |
44 | 44 |
|
45 | | - def __init__(self, source, type_, key): |
| 45 | + def __init__(self, source, type_, key) -> None: |
46 | 46 | super(TypingInteraction, self).__init__(source) |
47 | 47 | self.type = type_ |
48 | 48 | self.key = key |
49 | 49 |
|
50 | | - def encode(self): |
| 50 | + def encode(self) -> dict: |
51 | 51 | return {"type": self.type, "value": self.key} |
0 commit comments