aboutsummaryrefslogtreecommitdiff
path: root/sdk-modifications/libsrc/key/key.h
blob: 21674ecbe43c7acef95ac76f86f1c76ba476b646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __KEY_H__
#define __KEY_H__

#ifdef __cplusplus
extern "C" {
#endif

#define KEY_PRESS(key, key_id)	(!(key & (key_id<<16)) && (key & key_id))
#define KEY_HOLD(key, key_id)	((key & (key_id<<16)) && (key & key_id))
#define KEY_RELEASE(key, key_id)	((key & (key_id<<16)) && !(key & key_id))

/*
*   Function: only detect the key pressed or not
*/
unsigned int getKey(void);

/*
*   Function: can get the detail information about key pressed, hold, or release
*/
unsigned int getKey1(void);

/*
*   Function: detect the key pressed or not and touched position
*/
extern unsigned int getInput(struct key_buf *input);

#ifdef __cplusplus
}
#endif

#endif //__KEY_H__