RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Joywin32.h
1/*
2# Joystick VRPN Driver based on Win32.
3# written by Sebastien MARAUX, ONDIM SA (France)
4# maraux@ondim.fr
5*/
6
7#ifndef VRPN_WIN32JOYSTICK_H
8#define VRPN_WIN32JOYSTICK_H
9
10#if defined(_WIN32)
11
12#include "vrpn_Analog.h"
13#include "vrpn_Button.h"
14
15#include <basetsd.h>
16#include <mmsystem.h>
17
18class VRPN_API vrpn_Joywin32: public vrpn_Analog, public vrpn_Button_Filter
19{
20public:
21 vrpn_Joywin32 (const char * name, vrpn_Connection * c, vrpn_uint8 joyNumber = 1, vrpn_float64 readRate = 60, vrpn_uint8 mode = 0, vrpn_int32 deadzone = 0);
22
23 //~vrpn_Joywin32 ();
24
25 // Called once through each main loop iteration to handle
26 // updates.
27 virtual void mainloop ();
28
29protected:
30 int _status;
31 vrpn_uint8 _mode; // raw data , 0;1 or -1;1 normalized data for axes
32
33 struct timeval _timestamp; // Time of the last report from the device
34 vrpn_float64 _read_rate; // How many times per second to read the device
35 vrpn_float64 _deadzone; // apply a dead zone to analog inputs
36
37 virtual vrpn_int32 get_report(void); // Try to read a report from the device
38 void clear_values(void); // Clear the Analog and Button values
39 void init_joystick(void); // try to (re-)initialize the joystick
40
41 // send report iff changed
42 virtual void report_changes (vrpn_uint32 class_of_service
43 = vrpn_CONNECTION_LOW_LATENCY);
44 // send report whether or not changed
45 virtual void report (vrpn_uint32 class_of_service
46 = vrpn_CONNECTION_LOW_LATENCY);
47
48 vrpn_uint32 _numbuttons; // How many buttons
49 vrpn_uint32 _numchannels; // How many analog channels
50
51 vrpn_uint8 _joyNumber;
52 struct timeval last_error_report; // When the last error report was sent
53
54 // joystick caps
55 JOYCAPS _jc;
56};
57#endif
58#endif
59
定义 vrpn_Analog.h:28
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
virtual void mainloop()=0
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562