mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
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:
parent
77dd63ac83
commit
e361d2f498
4 changed files with 15 additions and 32 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue