mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
term_getch() -> term_gets() which can be used to read multiple keypresses at
once. Also fixes keyboard not working with netbsd. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1935 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
09ca58961b
commit
801e593718
5 changed files with 24 additions and 21 deletions
|
|
@ -363,18 +363,23 @@ void term_stop(void)
|
|||
irssi_redraw();
|
||||
}
|
||||
|
||||
int term_getch(void)
|
||||
int term_gets(unsigned char *buffer, int size)
|
||||
{
|
||||
int key;
|
||||
|
||||
key = getch();
|
||||
if (key == ERR)
|
||||
return -1;
|
||||
int key, count;
|
||||
|
||||
for (count = 0; count < size; ) {
|
||||
key = getch();
|
||||
#ifdef KEY_RESIZE
|
||||
if (key == KEY_RESIZE)
|
||||
return -1;
|
||||
if (key == KEY_RESIZE)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
return key;
|
||||
if (key == ERR)
|
||||
break;
|
||||
|
||||
buffer[count] = key;
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue