aboutsummaryrefslogtreecommitdiff
path: root/utils/adlmidi-2/input.hpp
blob: 0cafd51e9669366cbf2b07043f4d783781024e89 (plain)
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
#ifndef _WIN32
#include <unistd.h>
#endif

#ifdef _WIN32
# include <cctype>
# define WIN32_LEAN_AND_MEAN
# ifndef NOMINMAX
#   define NOMINMAX //To don't damage std::min and std::max
# endif
# include <windows.h>
#endif

#ifdef __DJGPP__
#include <conio.h>
#include <pc.h>
#include <dpmi.h>
#include <go32.h>
#include <sys/farptr.h>
#include <sys/exceptn.h>
#include <dos.h>
#include <stdlib.h>
#define BIOStimer _farpeekl(_dos_ds, 0x46C)
static const unsigned NewTimerFreq = 209;
#elif !defined(_WIN32) || defined(__CYGWIN__)
# include <termios.h>
# include <fcntl.h>
# include <sys/ioctl.h>
# include <csignal>
#endif

class xInput
{
    #ifdef _WIN32
    void *inhandle;
    #endif
    #if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__) && !defined(__APPLE__)
    struct termio back;
    #endif
public:
    xInput();
    ~xInput();

    char PeekInput();
};

extern xInput Input;