ASCII-GFX  2.0
joystick.h
Go to the documentation of this file.
1 // SDL joystick input for NCurses
2 // (c) 2020 by Stefan Roettger
3 
4 #pragma once
5 
7 bool joystick_init();
8 
10 bool joystick_detected();
11 
13 void configure_joystick(bool on);
14 
16 void configure_axis1(int axis);
17 
19 void configure_inverted1(bool invert = true);
20 
22 void configure_axis2(int axis);
23 
25 void configure_inverted2(bool invert = true);
26 
28 void configure_fire1(int button);
29 
31 void configure_fire2(int button);
32 
34 bool joystick_left();
35 
37 bool joystick_right();
38 
40 bool joystick_up();
41 
43 bool joystick_down();
44 
46 bool joystick_fire1();
47 
49 bool joystick_fire2();
50 
51 // decode joystick state
52 void joystick_state(int *dx, int *dy, int *buttons);
53 
55 void joystick_exit();
configure_inverted1
void configure_inverted1(bool invert=true)
configure inverted joystick axis #1
Definition: joystick.cpp:75
joystick_state
void joystick_state(int *dx, int *dy, int *buttons)
Definition: joystick.cpp:205
joystick_init
bool joystick_init()
init joystick
Definition: joystick.cpp:28
configure_fire2
void configure_fire2(int button)
configure fire button #2
Definition: joystick.cpp:107
configure_inverted2
void configure_inverted2(bool invert=true)
configure inverted joystick axis #2
Definition: joystick.cpp:91
joystick_left
bool joystick_left()
joystick moved left
Definition: joystick.cpp:115
joystick_fire1
bool joystick_fire1()
joystick fire button 1 pressed
Definition: joystick.cpp:175
joystick_fire2
bool joystick_fire2()
joystick fire button 2 pressed
Definition: joystick.cpp:190
joystick_right
bool joystick_right()
joystick moved right
Definition: joystick.cpp:130
configure_fire1
void configure_fire1(int button)
configure fire button #1
Definition: joystick.cpp:99
configure_axis1
void configure_axis1(int axis)
configure joystick axis #1
Definition: joystick.cpp:67
joystick_down
bool joystick_down()
joystick moved down
Definition: joystick.cpp:160
joystick_exit
void joystick_exit()
exit SDL
Definition: joystick.cpp:218
joystick_detected
bool joystick_detected()
joystick detected
Definition: joystick.cpp:49
configure_axis2
void configure_axis2(int axis)
configure joystick axis #2
Definition: joystick.cpp:83
configure_joystick
void configure_joystick(bool on)
configure joystick
Definition: joystick.cpp:59
joystick_up
bool joystick_up()
joystick moved up
Definition: joystick.cpp:145