#include "kbd.h";
void KBD_SetExtTpEvent( const KBDButton event_list[], u16 num_element, KBDExtTpEventCallback callback, void* param );
event_list | Pointer to the additional touch events array |
num_element | Number of elements in the additional touch event list |
callback | Callback function called when an additional touch event occurs |
param | Parameters passed to the callback function for additional touch events |
None.
Sets the events that react to touch input, including input other than keyboard buttons. The callback function set within this function is called with KBD_Update()
(or KBD_UpdateValue()
). The KBDButton
type and the KBDButtonRect
type within it are defined below.
typedef struct tagKBDButton
{
KBDButtonRect rect; // Event button rectangle
s16 group_offset; // Must be 0
u16 id; // Event ID
} KBDButton;
typedef struct tagKBDButtonRect
{
u16 x:8;
u16 y:8;
u16 width:8;
u16 height:8;
} KBDButtonRect;
Creates the above KBDButton type array as the additional event list and passes the pointer to the event list and the number of elements in the array as arguments to the function.
However, the following holds for the id
member.
0x0000 - 0x00ff: Keyboard Buttons
0x0100 - 0xfeff: Touch Event Buttons that can be added by the application
0xff00 to 0xffff: System Reserved IDs
So use values in the range from 0x0100 to 0xfeff.
The additional touch event callback type KBDExtTpEventCallback
is defined below:
typedef void (*KBDExtTpEventCallback)( void* param, KBDTpEvent event, u16 pressd_id, u16 current_id, int x, int y );
This function does not call the callback if NULL is specified in callback
.
CONFIDENTIAL