Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created July 5, 2010 04:39
Show Gist options
  • Save duckinator/464003 to your computer and use it in GitHub Desktop.
Save duckinator/464003 to your computer and use it in GitHub Desktop.
char *Prompt()
{
HalKeyInfo keyinfo;
char *tmp = (char*)kmalloc(sizeof(char)*100);
int i;
printf("\n>> ");
for(i=0; keyinfo.key != '\n'; i++)
{
while(!HalKeyboardHasInput()); // Wait for input
keyinfo = HalKeyboardReadLetter();
if ( keyinfo.action == 0 ) {
printf("%c", keyinfo.key);
tmp[i] = keyinfo.key;
}
}
tmp[i] = '\0';
printf("tmp: %s\n", tmp+2);
return tmp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment