-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathkeyboard.h
More file actions
52 lines (47 loc) · 1.64 KB
/
Copy pathkeyboard.h
File metadata and controls
52 lines (47 loc) · 1.64 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _KEYBOARD_H
#define _KEYBOARD_H
#include "types.h"
class KEYS {
protected:
unsigned char joybuffer[256];
unsigned char joy_trans(unsigned char r);
//
static unsigned int nrOfJoys;
static SDL_GameController *sdlJoys[2];
static unsigned int joystickScanCodes[][5];
static unsigned char paddleValueX;
unsigned char getPcJoyState(unsigned int joyNr, unsigned int activeJoy);
unsigned char latched;
unsigned char keyReadMatrixRow(unsigned int r);
unsigned char blockMask;
virtual unsigned int fireButtonIndex(unsigned int a) const { return 6 + a; };
public:
KEYS();
virtual ~KEYS();
static void initPcJoys();
static void closePcJoys();
void latch(unsigned int keyrow, unsigned int joyrow);
unsigned char feedkey(unsigned char latch);
unsigned char feedjoy(unsigned char latch);
void empty(void);
static void swapjoy(void *none);
static unsigned int activejoy;
static unsigned int joystickScanCodeIndex;
static const char *activeJoyTxt() {
const char *txt[] = { "NONE", "PORT1", "PORT2", "BOTH" };
return txt[activejoy];
}
static void swapKeyset(void *none);
static const char *activeJoyKeyset() {
const char *txt[] = { "NUMPAD24680", "ARROWS+LSHIFT", "WASD+RShift" };
return txt[joystickScanCodeIndex];
}
unsigned char readLatch() { return latched | blockMask; };
void block(bool isBlocked) { blockMask = isBlocked ? 0xFF : 0x00; };
static void setPaddleValue(int value);
static unsigned char readPaddleAxis(unsigned short axis);
static unsigned char readPaddleFireButton(unsigned int paddleID);
unsigned char readSidcardJoyport();
};
extern rvar_t inputSettings[];
#endif // _KEYBOARD_H