forked from msokalski/asciicker
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamepad.h
33 lines (24 loc) · 910 Bytes
/
gamepad.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef GAMEPAD_H
#define GAMEPAD_H
void LoadGamePad();
void FreeGamePad();
void SetGamePadMapping(const uint8_t* map);
const uint8_t* GetGamePadMapping();
const char* GetGamePad(int* axes, int* buttons);
void ConnectGamePad(const char* name, int axes, int buttons, const uint8_t mapping[]);
void DisconnectGamePad();
// return num of outs
int UpdateGamePadAxis(int a, int16_t pos, uint32_t out[4]);
int UpdateGamePadButton(int b, int16_t pos, uint32_t out[1]);
void PaintGamePad(AnsiCell* ptr, int width, int height, uint64_t stamp);
void GamePadOpen( void (*close)(void* _g), void* g );
void GamePadContact(int id, int ev, int x, int y, uint64_t stamp);
/*
id = contact (0:lmb, 1:touch0, 2:touch1, ...)
ev = 0:begin 1;move 2:end 3:cancel
*/
void GamePadKeyb(int key, uint64_t stamp);
/*
key = 5:l,6:r,3:u,4:d, 1:enter, 0:space, 2:(backslash,escape,backspace), 7:(c,C), 8:(r,R)
*/
#endif