RflySimSDK
v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
simulink
vrpn
vrpn_Event.h
1
/**************************************************************************************************/
2
/* */
3
/* Copyright (C) 2004 Bauhaus University Weimar */
4
/* Released into the public domain on 6/23/2007 as part of the VRPN project */
5
/* by Jan P. Springer. */
6
/* */
7
/*************************************************************************************************/
8
/* */
9
/* module : vrpn_Event.h */
10
/* project : */
11
/* description: provide functionality for event interface */
12
/* */
13
/**************************************************************************************************/
14
15
#ifndef _VRPN_EVENT_H_
16
#define _VRPN_EVENT_H_
17
18
#include "vrpn_Shared.h"
// For struct timeval
19
20
namespace
vrpn_Event {
21
22
// the struct read by the system when reading
23
struct
input_event
{
24
25
struct
timeval time;
26
unsigned
short
type;
27
unsigned
short
code;
28
unsigned
int
value;
29
};
30
31
// open the specified event interface
32
// return a valid handle to the event interface or -1 if the open fails
33
// file - full path of the event interface file
34
int
vrpn_open_event(
const
char
* file);
35
36
// close the event interface
37
// fd - handle to the event interface
38
void
vrpn_close_event(
const
int
fd);
39
40
// read from the interface
41
// returns the number of bytes read successfully
42
// fd - handle for the event interface
43
// data - handle to the read data
44
// max_elements - maximum number of elements to read
45
int
vrpn_read_event(
int
fd,
46
input_event
* data,
47
int
max_elements);
48
}
49
50
#endif
// _VRPN_EVENT_H_
vrpn_Event::input_event
定义
vrpn_Event.h:23
制作者
1.11.0