Update api : spnav_wait_event_timeout
This commit is contained in:
parent
2feb735f5b
commit
1a2e82040d
8
spnav.c
8
spnav.c
@ -127,6 +127,14 @@ int spnav_wait_event(spnav_event *event) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spnav_wait_event_timeout(spnav_event *event, int milliseconds) {
|
||||||
|
if (device == NULL) {
|
||||||
|
DEBUG_PRINT("spnav_wait_event_timeout(): device not connected.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
read_event(device, event, milliseconds);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
int spnav_wait_event(spnav_event *event);
|
int spnav_wait_event(spnav_event *event);
|
||||||
int spnav_poll_event(spnav_event *event, int timeout); */
|
int spnav_poll_event(spnav_event *event, int timeout); */
|
3
spnav.h
3
spnav.h
@ -46,8 +46,9 @@ extern "C" {
|
|||||||
|
|
||||||
int SPNAV_API_EXPORT_CALL spnav_open(void);
|
int SPNAV_API_EXPORT_CALL spnav_open(void);
|
||||||
int SPNAV_API_EXPORT_CALL spnav_close(void);
|
int SPNAV_API_EXPORT_CALL spnav_close(void);
|
||||||
|
// TODO : return event type
|
||||||
int SPNAV_API_EXPORT_CALL spnav_wait_event(spnav_event *event);
|
int SPNAV_API_EXPORT_CALL spnav_wait_event(spnav_event *event);
|
||||||
int SPNAV_API_EXPORT_CALL spnav_poll_event(spnav_event *event, int timeout);
|
int SPNAV_API_EXPORT_CALL spnav_wait_event_timeout(spnav_event *event, int timeout);
|
||||||
//spnav_event SPNAV_API_EXPORT_CALL read_event(int timeout);
|
//spnav_event SPNAV_API_EXPORT_CALL read_event(int timeout);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user