FS2_Open
Open source remastering of the Freespace 2 engine
joy.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __JOY_H__
13 #define __JOY_H__
14 
15 #define JOY_NUM_BUTTONS 32
16 #define JOY_NUM_HAT_POS 4
17 #define JOY_TOTAL_BUTTONS (JOY_NUM_BUTTONS + JOY_NUM_HAT_POS)
18 #define JOY_NUM_AXES 6
19 
20 #define JOY_HATBACK (JOY_NUM_BUTTONS)
21 #define JOY_HATFORWARD (JOY_NUM_BUTTONS+1)
22 #define JOY_HATLEFT (JOY_NUM_BUTTONS+2)
23 #define JOY_HATRIGHT (JOY_NUM_BUTTONS+3)
24 
25 #define JOY_AXIS_UNDEFINED -10000
26 
27 typedef struct Joy_info {
32 } Joy_info;
33 
34 extern int Joy_sensitivity;
35 extern int Dead_zone_size; // percentage of range that is dead zone
36 
37 int joy_init();
38 void joy_flush();
39 int joy_get_pos(int * x, int * y, int *z, int *r);
40 int joy_down_count(int btn, int reset_count = 1);
41 int joy_down(int btn);
42 int joy_up_count(int btn);
43 float joy_down_time(int btn);
44 void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max);
45 void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max);
46 void joy_set_ul();
47 void joy_set_lr();
48 void joy_set_cen();
49 void joy_cheap_cal();
50 int joystick_read_raw_axis( int num_axes, int * axis );
51 void joy_get_delta(int *dx, int *dy);
52 int joy_get_scaled_reading(int raw, int axn);
53 int joy_get_unscaled_reading(int raw, int axn);
54 void joy_close();
55 
56 #endif /* __JOY_H__ */
int axis_max[JOY_NUM_AXES]
Definition: joy.h:31
#define JOY_NUM_AXES
Definition: joy.h:18
int axis_center[JOY_NUM_AXES]
Definition: joy.h:30
Definition: joy.h:27
int joy_down(int btn)
Definition: joy-unix.cpp:93
int joy_up_count(int btn)
int joystick_read_raw_axis(int num_axes, int *axis)
Definition: joy-unix.cpp:549
int joy_init()
Definition: joy-unix.cpp:466
void joy_set_ul()
void joy_get_delta(int *dx, int *dy)
int axis_min[JOY_NUM_AXES]
Definition: joy.h:29
void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max)
int joy_down_count(int btn, int reset_count=1)
Definition: joy-unix.cpp:105
GLdouble GLdouble GLdouble r
Definition: Glext.h:5337
int Dead_zone_size
Definition: joy-unix.cpp:27
GLdouble GLdouble z
Definition: Glext.h:5451
int joy_get_unscaled_reading(int raw, int axn)
Definition: joy-unix.cpp:171
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
void joy_set_cen()
Definition: joy-unix.cpp:544
struct Joy_info Joy_info
void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max)
void joy_close()
Definition: joy-unix.cpp:53
int joy_get_scaled_reading(int raw, int axn)
Definition: joy-unix.cpp:204
void joy_set_lr()
void joy_flush()
Definition: joy-unix.cpp:152
int joy_get_pos(int *x, int *y, int *z, int *r)
Definition: joy-unix.cpp:267
int axis_valid[JOY_NUM_AXES]
Definition: joy.h:28
void joy_cheap_cal()
GLint y
Definition: Gl.h:1505
float joy_down_time(int btn)
Definition: joy-unix.cpp:120
int Joy_sensitivity
Definition: joy-unix.cpp:29