aboutsummaryrefslogtreecommitdiff
path: root/utils/adlmidi-2/input.cc
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2021-01-07 13:17:37 +0300
committerWohlstand <admin@wohlnet.ru>2021-01-07 13:17:37 +0300
commit57485b48ca9ce31e6b94b1ce5f1d892ff0b786bf (patch)
tree6efc3ff09f4cde2d9d0a7233518031b071d456af /utils/adlmidi-2/input.cc
parent2712113e3895988a0f712e8bd1c0e109e6d6f139 (diff)
downloadlibADLMIDI-57485b48ca9ce31e6b94b1ce5f1d892ff0b786bf.tar.gz
libADLMIDI-57485b48ca9ce31e6b94b1ce5f1d892ff0b786bf.tar.bz2
libADLMIDI-57485b48ca9ce31e6b94b1ce5f1d892ff0b786bf.zip
adlmidi2: Add the test check for termio and termios type
#241
Diffstat (limited to 'utils/adlmidi-2/input.cc')
-rw-r--r--utils/adlmidi-2/input.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/adlmidi-2/input.cc b/utils/adlmidi-2/input.cc
index bb276cb..80aba57 100644
--- a/utils/adlmidi-2/input.cc
+++ b/utils/adlmidi-2/input.cc
@@ -7,7 +7,7 @@ xInput::xInput()
#endif
#if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__) && !defined(__APPLE__)
ioctl(0, TCGETA, &back);
- struct termio term = back;
+ InputTermio_t term = back;
term.c_lflag &= ~(ICANON | ECHO);
term.c_cc[VMIN] = 0; // 0=no block, 1=do block
if(ioctl(0, TCSETA, &term) < 0)
@@ -32,6 +32,7 @@ char xInput::PeekInput()
return c ? c : getch();
}
#endif
+
#ifdef _WIN32
DWORD nread = 0;
INPUT_RECORD inbuf[1];
@@ -48,9 +49,11 @@ char xInput::PeekInput()
}
}
#endif
+
#if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__)
char c = 0;
if(read(0, &c, 1) == 1) return c;
#endif
+
return '\0';
}