[MPlayer-users] 'q' to quit

Nilmoni Deb ndeb at ece.cmu.edu
Tue Jan 22 00:12:01 CET 2002


Smith, there's a better way to do it. Change the switch statement
parameter in line 1925 (mplayer.c CVS version 1.373) to :

(!use_stdin && (c=getch2(0))>0) || (c=mplayer_get_key())>0)
switch(tolower(c)){

Also, the ctype.h header has to be included.

The functions strtolower()/strtoupper() should not be used as c is not a
string but one character.

thanks
- Nil

--------------------------------------------------------------
Here is a 'quick' hack, not really a patch as you might not want to do it.
(Some people prefer to disable the capslock instead.) 

File: mplayer.c
Line 1916 /* interactive mode */
scroll down to line 1955 where it has
" case 'q':
   exit_player(MSGTR_Exit_quit); "
 and add either before or after the case 'q' line:
" case 'Q': "  (no quotes, of course). 

Thats just one option.  Another is
to use a strtolower() to take everything from the keyboard as
lowercase, or strtoupper() if you want to do it the other way round. Just
some things I picked up over the years fooling around with different
codes. 

/S. Smith




More information about the MPlayer-users mailing list