Remove the need to buffer input by moving the 'gui key pressed' events

generation into term_gets.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4805 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-04-16 21:14:05 +00:00 committed by exg
commit e361d2f498
4 changed files with 15 additions and 32 deletions

View file

@ -19,6 +19,7 @@
*/
#include "module.h"
#include "signals.h"
#include "settings.h"
#include "term.h"
@ -384,16 +385,15 @@ void term_set_input_type(int type)
{
}
int term_gets(unichar *buffer, int size)
void term_gets(void)
{
int count;
#ifdef WIDEC_CURSES
wint_t key;
#else
int key;
#endif
for (count = 0; count < size; ) {
for (;;) {
#ifdef WIDEC_CURSES
if (get_wch(&key) == ERR)
#else
@ -405,8 +405,6 @@ int term_gets(unichar *buffer, int size)
continue;
#endif
buffer[count++] = key;
signal_emit("gui key pressed", 1, GINT_TO_POINTER(key));
}
return count;
}