4 * Copyright (c) 2007 KO Myung-Hun (komh@chollian.net)
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 #include "input/keycodes.h"
33 #include "input/input.h"
37 #if defined(HAVE_LANGINFO) && defined(CONFIG_ICONV)
42 int mp_input_slave_cmd_func( int fd
, char *dest
, int size
)
45 CHAR szPipeName
[ 100 ];
51 DosGetInfoBlocks( NULL
, &ppib
);
53 sprintf( szPipeName
, "\\PIPE\\MPLAYER\\%lx", ppib
->pib_ulpid
);
55 rc
= DosOpen( szPipeName
, &hpipe
, &ulAction
, 0, FILE_NORMAL
,
56 OPEN_ACTION_OPEN_IF_EXISTS
,
57 OPEN_SHARE_DENYREADWRITE
| OPEN_ACCESS_READWRITE
,
60 return MP_INPUT_NOTHING
;
62 rc
= DosRead( hpipe
, dest
, size
, &cbActual
);
64 return MP_INPUT_NOTHING
;
69 DosWrite( hpipe
, &rc
, sizeof( ULONG
), &cbActual
);
77 int screen_width
= 80;
78 int screen_height
= 24;
79 char *erase_to_end_of_line
= NULL
;
81 void get_screen_size( void )
85 vmi
.cb
= sizeof( VIOMODEINFO
);
87 VioGetMode( &vmi
, 0 );
89 screen_width
= vmi
.col
;
90 screen_height
= vmi
.row
;
93 static int getch2_status
= 0;
95 static int getch2_internal( void )
102 if( KbdCharIn( &kki
, IO_NOWAIT
, 0 ))
109 if(( kki
.chChar
== 0x00 ) || ( kki
.chChar
== 0xE0 ))
125 case 0x53 : // Delete
128 case 0x52 : // Insert
137 case 0x49 : // Page Up
140 case 0x51 : // Page Down
141 return KEY_PAGE_DOWN
;
148 case 0x08 : // Backspace
156 if( kki
.chScan
== 0xE0 )
168 void getch2(struct mp_fifo
*fifo
)
172 key
= getch2_internal();
174 mplayer_put_key(fifo
, key
);
177 void getch2_enable( void )
182 void getch2_disable( void )
188 char *get_term_charset( void )
190 char *charset
= NULL
;
193 setlocale( LC_CTYPE
, "");
194 charset
= strdup( nl_langinfo( CODESET
));
195 setlocale( LC_CTYPE
, "C");