예제 #1
0
파일: hu_lib.c 프로젝트: AlexMax/winmbf
boolean HUlib_keyInIText(hu_itext_t* it, unsigned char ch)
{
  if (ch >= ' ' && ch <= '_')
    HUlib_addCharToTextLine(&it->l, (char) ch);
  else if (ch == key_backspace)                  // phares
    HUlib_delCharFromIText(it);
  else if (ch != key_enter)                      // phares
    return false;                            // did not eat key
  return true;                                 // ate the key
}
예제 #2
0
// wrapper function for handling general keyed input.
// returns true if it ate the key
boolean
HUlib_keyInIText
( hu_itext_t*	it,
  unsigned char ch )
{

    if (ch >= ' ' && ch <= '_') 
  	HUlib_addCharToTextLine(&it->l, (char) ch);
    else 
	if (ch == KEY_BACKSPACE) 
	    HUlib_delCharFromIText(it);
	else 
	    if (ch != KEY_ENTER) 
		return false; // did not eat key

    return true; // ate the key

}