File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change
1
+ # rpico_rgb_keypad_obs v1.0.1
2
+ #
1
3
# SPDX-FileCopyrightText: 2023 Martin Looker
2
4
#
3
5
# SPDX-License-Identifier: MIT
166
168
def press_kcs (kcs ):
167
169
print (f'keycode press { kcs } { KC_LIVE } ' )
168
170
if KC_LIVE :
169
- for kc in kcs :
170
- keyboard .press (kc )
171
+ if len (kcs ) == 1 :
172
+ keyboard .press (kcs [0 ])
173
+ elif len (kcs ) == 2 :
174
+ keyboard .press (kcs [0 ], kcs [1 ])
175
+ elif len (kcs ) == 3 :
176
+ keyboard .press (kcs [0 ], kcs [1 ], kcs [2 ])
171
177
172
178
# Releases a list of keycodes
173
179
def release_kcs (kcs ):
174
180
print (f'keycode release { kcs } { KC_LIVE } ' )
175
181
if KC_LIVE :
176
- for kc in kcs :
177
- keyboard .release (kc )
182
+ if len (kcs ) == 1 :
183
+ keyboard .release (kcs [0 ])
184
+ elif len (kcs ) == 2 :
185
+ keyboard .release (kcs [0 ], kcs [1 ])
186
+ elif len (kcs ) == 3 :
187
+ keyboard .release (kcs [0 ], kcs [1 ], kcs [2 ])
178
188
179
189
# Process key presses/releases
180
190
for key in keys :
You can’t perform that action at this time.
0 commit comments