Skip to content

Commit d08cecf

Browse files
committed
keypad: add doc that reset() can be used to determine keys held down at startup
1 parent c5a929e commit d08cecf

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

shared-bindings/keypad/KeyMatrix.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ static void check_for_deinit(keypad_keymatrix_obj_t *self) {
159159
//| """Reset the internal state of the scanner to assume that all keys are now released.
160160
//| Any key that is already pressed at the time of this call will therefore immediately cause
161161
//| a new key-pressed event to occur.
162+
//| For instance, if you call `reset()` immediately after creating a `KeyMatrix` object
163+
//| at the beginning of your program, the events it generates will let you determine which keys
164+
//| were being held down at program start.
162165
//| """
163166
//| ...
164167

shared-bindings/keypad/Keys.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_keys___exit___obj, 4, 4, keypa
147147
//| """Reset the internal state of the scanner to assume that all keys are now released.
148148
//| Any key that is already pressed at the time of this call will therefore immediately cause
149149
//| a new key-pressed event to occur.
150+
//| For instance, if you call `reset()` immediately after creating a `Keys` object
151+
//| at the beginning of your program, the events it generates will let you determine which keys
152+
//| were being held down at program start.
150153
//| """
151154
//| ...
152155

shared-bindings/keypad/ShiftRegisterKeys.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_shiftregisterkeys___exit___obj
201201
//| """Reset the internal state of the scanner to assume that all keys are now released.
202202
//| Any key that is already pressed at the time of this call will therefore immediately cause
203203
//| a new key-pressed event to occur.
204+
//| For instance, if you call `reset()` immediately after creating a `ShiftRegisterKeys` object
205+
//| at the beginning of your program, the events it generates will let you determine which keys
206+
//| were being held down at program start.
204207
//| """
205208
//| ...
206209

shared-bindings/keypad_demux/DemuxKeyMatrix.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ static void check_for_deinit(keypad_demux_demuxkeymatrix_obj_t *self) {
147147
//| """Reset the internal state of the scanner to assume that all keys are now released.
148148
//| Any key that is already pressed at the time of this call will therefore immediately cause
149149
//| a new key-pressed event to occur.
150+
//| For instance, if you call `reset()` immediately after creating a `DemuxKeyMatrix` object
151+
//| at the beginning of your program, the events it generates will let you determine which keys
152+
//| were being held down at program start.
150153
//| """
151154
//| ...
152155

0 commit comments

Comments
 (0)