
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
161
Ver.1.0.0
}
#if
(DEEPBACK_FAST_KEYSCAN_ENABLE)
if
(deepback_key_state != DEEPBACK_KEY_IDLE){
deepback_post_proc();
}
#endif
}
The “deepback_pre_proc” realizes buffer processing of fast keyscan value, as shown
below: After connection is established between Slave and Master, if no button state
update is detected in a kb_key_scan, the buffered kb_event_cache value will be used as
the current newest button state update.
For button release processing, it’s needed to check current matrix keyboard state: If
there’s button pressed, since actual button release generates a release action, it’s not
needed to add manual release; if current button is released, it’s needed to mark that a
manual release event should be added, otherwise button may fail to be released since
buffered button press event stays valid.
The “deepback_pre_proc” specifies whether manual release is needed. The
“deepback_post_proc” will determine whether to push a button release event into BLE TX
FIFO accordingly.
7.6 Repeat Key Processing
When a button is
pressed and held, it’s needed to enable repeat key function to
repeatedly send the key value with a specific interval.
The
“repeat key” function is masked by default. By configuring related macros in
app_config.h, this function can be controlled correspondingly.
//repeat key
#define
KB_REPEAT_KEY_ENABLE
0
#define
KB_REPEAT_KEY_INTERVAL_MS
200
#define
KB_REPEAT_KEY_NUM
1
#define
KB_MAP_REPEAT
{VK_1, }
1) KB_REPEAT_KEY_ENABLE
This macro serves to enable or mask the repeat key function. To use this function,
first set “KB_REPEAT_KEY_ENABLE” as 1.
2) KB_REPEAT_KEY_INTERVAL_MS
This macro serves to set the repeat interval time. For example, if it’s set as 200ms, it
indicates when a button is held, kb_key_scan will return an update with the interval
of 200ms. Current button state will be available in kb_event.
3) KB_REPEAT_KEY_NUM and KB_MAP_REPEAT