Example #1
0
void Main_Thread(void){

	Keycode Code = KEY_UNKNOWN;
	Print("Hola vo!\n");
	
	/*KEY_CTRL_FLAG es una mascara, si le aplico XOR tendo el Keycode
	 * de lo de la tecla que aprete..*/
	Code = Wait_For_Key(); 
	while( !((Code^KEY_CTRL_FLAG)==(uchar_t)'d') ){
		if ((Code&KEY_RELEASE_FLAG) == 0){
			Print("%c",Code);
		}
		Code = Wait_For_Key();
	}
	Print("Ctrl+d: no escribis mas ... \n");
}
Example #2
0
void Print_Key_Pressed()
{
    Keycode key_code = 0;

    Print("Welcome to Caro!\n");
    while (!Should_Exit(key_code))
    {
        key_code = Wait_For_Key();
        if ( Key_Pressed(key_code) )
        {
            Print("%c",key_code);
        }
    }

    Print("\nGoodbye!\n");
}
Example #3
0
static void Keyb()
{
  Keycode keypressed = 0x0000;
  Print("Hello from Edu\n");
  while(keypressed!=CTRL_D_KEYCODE){
    keypressed = Wait_For_Key();
    if (!(keypressed & KEY_RELEASE_FLAG)){
      // mientras la tecla se mantenga apretada..
      if (!(keypressed & KEY_CTRL_FLAG) && !(keypressed & KEY_ALT_FLAG)){
        // No imprimir Ctrl+algo.. a ALT+algo o Shift
        Print("%c",(char) keypressed);
      }
    }
    //si la tecla se suelta, no debo imprimir ni hacer otro tipo de manejo.
  }
}
Example #4
0
void funct_eigen()
{
	Keycode c = 0;

	Print("Hallo from Franz!\n");

	do
	{
		c = Wait_For_Key();
		if((c&KEY_RELEASE_FLAG) == 0)			//Beim Taste auslassen nicht mehr ausgeben
		{
			Print("%c\n", c);
		}
	}
	while((c & KEY_SPECIAL_FLAG) == 1 || (c & KEY_CTRL_FLAG) == 0 || (char)c != 'd');
//	while(c != 16484);

	Exit(0);
}
Example #5
0
/*
 * Get a single key press from the console.
 * Suspends the user process until a key press is available.
 * Params:
 *   state - processor registers from user mode
 * Returns: the key code
 *          -1 if this is a background process
 */
static int Sys_GetKey(struct Interrupt_State *state) {
    return Wait_For_Key();
}
Example #6
0
/*
 * Get a single key press from the console.
 * Suspends the user process until a key press is available.
 * Params:
 *   state - processor registers from user mode
 * Returns: the key code
 */
static int Sys_GetKey(struct Interrupt_State* state)
{
	return Wait_For_Key();
    //TODO("GetKey system call");
}
Example #7
0
/*
 * Get a single key press from the console.
 * Suspends the user process until a key press is available.
 * Params:
 *   state - processor registers from user mode
 * Returns: the key code
 */
static int Sys_GetKey(struct Interrupt_State* state)
{
    int keyCode = Wait_For_Key();
    return keyCode;
}