示例#1
0
文件: screen.c 项目: Hoffa/nFrotz
zchar console_read_input (int max, zchar *buf, zword timeout, bool continued)
{
    zchar key;
    int i;

    /* Make sure there is some space for input */

    if (cwin == 0 && units_left () + os_string_width (buf) < 10 * font_width)
        screen_new_line ();

    /* Make sure the input line is visible */

    if (continued && input_redraw)
        screen_write_input (buf, -1);

    input_window = cwin;
    input_redraw = FALSE;

    /* Get input line from IO interface */

    cwp->x_cursor -= os_string_width (buf);
    key = os_read_line (max, buf, timeout, units_left (), continued);
    cwp->x_cursor += os_string_width (buf);

    if (key != ZC_TIME_OUT)
        for (i = 0; i < 8; i++)
            wp[i].line_count = 0;

    /* Add a newline if the input was terminated normally */

    if (key == ZC_RETURN)
        screen_new_line ();

    return key;

}/* console_read_input */
示例#2
0
zchar Processor::console_read_input(int max, zchar *buf, zword timeout, bool continued) {
	return os_read_line(max, buf, timeout, max, continued);
}