示例#1
0
void terminal_readline()
{
	uint32_t x = 0;
	uint32_t y = 0;

	while (1) 
	{
		KeyboardUpdate();
		char c = KeyboardGetChar();

		if (c == 0)
			continue;

		terminal_screen[y*terminal_width + x] = c;
		if (c == '\n') 
		{
			y++;
			y = y % 75;
			x = 0;
		}
		else
		{
			x++;
			x = x % 240;
		}

		terminal_display();
	}

}
示例#2
0
文件: FORM.C 项目: LesInk/Test
T_void FormHandleKey(E_keyboardEvent event, T_word16 scankey)
{
    T_formObjectStruct *p_object;
    T_word16 i;
    T_buttonID buttonID;
    E_buttonAction buttonAction;

    DebugRoutine("FormHandleKey");
    if (G_formHasButtons == TRUE)
        ButtonKeyControl(event, scankey);
    if (G_formHasTextBoxes == TRUE)
        TxtboxKeyControl(event, scankey);

    /* Make sure the gamma key is correct. */
    if (KeyMapGetScan(KEYMAP_GAMMA_CORRECT) == TRUE) {
        MessagePrintf("Gamma level %d", ColorGammaAdjust());
        ColorUpdate(1);
        while (KeyMapGetScan(KEYMAP_GAMMA_CORRECT) == TRUE) {
#ifdef WIN32
            extern void KeyboardUpdate(E_Boolean updateBuffers);
            KeyboardUpdate(TRUE);
#endif
        }
    }

    DebugEnd();
}