RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Spaceball.h
1#ifndef VRPN_SPACEBALL_H
2#define VRPN_SPACEBALL_H
3
4#include "vrpn_Analog.h" // for vrpn_Serial_Analog
5#include "vrpn_Button.h" // for vrpn_Button_Filter
6#include "vrpn_Configure.h" // for VRPN_API
7#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc
8#include "vrpn_Shared.h" // for timeval
9#include "vrpn_Types.h" // for vrpn_uint32
10
11class VRPN_API vrpn_Spaceball: public vrpn_Serial_Analog
12 ,public vrpn_Button_Filter
13{
14 public:
15 vrpn_Spaceball (const char * name, vrpn_Connection * c,
16 const char * port, int baud);
17
18 ~vrpn_Spaceball () {};
19
21 virtual void mainloop ();
22
23 virtual int reset(void);
24
25 protected:
28 unsigned char buf[512];
29 int bufpos;
31 int packlen;
38 struct timeval timestamp;
39
40 virtual void clear_values(void);
41
44 virtual int get_report(void);
45
47 virtual void report_changes
48 (vrpn_uint32 class_of_service
49 = vrpn_CONNECTION_LOW_LATENCY);
50
52 virtual void report
53 (vrpn_uint32 class_of_service
54 = vrpn_CONNECTION_LOW_LATENCY);
55
56 // NOTE: class_of_service is only applied to vrpn_Analog
57 // values, not vrpn_Button, which are always vrpn_RELIABLE
58};
59
60#endif
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Analog.h:63
定义 vrpn_Spaceball.h:13
int packlen
Expected packet length
定义 vrpn_Spaceball.h:31
int leftymode4000
Spaceball 4000 is in lefty mode
定义 vrpn_Spaceball.h:36
int escapedchar
We're processing an escaped char
定义 vrpn_Spaceball.h:32
int resetoccured
A reset event has occurred
定义 vrpn_Spaceball.h:34
int _numchannels
How many analog channels to open
定义 vrpn_Spaceball.h:27
virtual int get_report(void)
report received, 0 otherwise. Sets status to current mode.
virtual void clear_values(void)
Set all buttons, analogs and encoders back to 0
virtual void mainloop()
Called once through each main loop iteration to handle updates.
virtual int reset(void)
Set device back to starting config
int bufpos
Current char pos in buffer
定义 vrpn_Spaceball.h:29
int spaceball4000
We found a Spaceball 4000
定义 vrpn_Spaceball.h:35
int erroroccured
A device error has occurred
定义 vrpn_Spaceball.h:33
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report whether or not changed
int null_radius
range where no motion should be reported
定义 vrpn_Spaceball.h:37
int _numbuttons
How many buttons to open
定义 vrpn_Spaceball.h:26
int packtype
What kind of packet we are decoding
定义 vrpn_Spaceball.h:30
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report iff changed