mirror of https://github.com/mpv-player/mpv
status management
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1633 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6326452f41
commit
b0dbb726dc
|
@ -199,6 +199,8 @@ found:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int getch2_status=0;
|
||||||
|
|
||||||
void getch2_enable(){
|
void getch2_enable(){
|
||||||
struct termios tio_new;
|
struct termios tio_new;
|
||||||
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
|
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
|
||||||
|
@ -219,9 +221,11 @@ struct termios tio_new;
|
||||||
#else
|
#else
|
||||||
ioctl(0,TCSETS,&tio_new);
|
ioctl(0,TCSETS,&tio_new);
|
||||||
#endif
|
#endif
|
||||||
|
getch2_status=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getch2_disable(){
|
void getch2_disable(){
|
||||||
|
if(!getch2_status) return; // already disabled / never enabled
|
||||||
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
|
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
|
||||||
tcsetattr(0,TCSANOW,&tio_orig);
|
tcsetattr(0,TCSANOW,&tio_orig);
|
||||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||||
|
@ -229,5 +233,6 @@ void getch2_disable(){
|
||||||
#else
|
#else
|
||||||
ioctl(0,TCSETS,&tio_orig);
|
ioctl(0,TCSETS,&tio_orig);
|
||||||
#endif
|
#endif
|
||||||
|
getch2_status=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue