This has just *got* to be a FAQ by now -- vgersh99 do you want to do the honours?
Mike
______________________________________________________________________
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.
Since you're planning on creating a FAQ for changing the terminal driver, could you also add something like this:
# readkey: This function saves the current terminal settings and
# sets the terminal to raw mode with the unix stty command. Retrieve
# 1 character with the dd command and reset original terminal settings
# with stty before returning the character to calling script.
function readkey {
local anykey oldstty
oldstty=`stty -g`
stty -icanon -echo min 1 time 0
anykey=`dd bs=1 count=1 <&0 2>/dev/null`
stty $oldstty
echo $anykey
} # end read_key
That's a new FAQ really Ed "How do I get user input one char at a time?"
Neat by the way, very neat; I've always avoided answering that question because I've never bothered to figure out how to do it! Mike
______________________________________________________________________
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.
Thanks for the "smiley face". Wish I could say I invented "getting one character at a time", but one of my peers gave it to me sometime in the early '90s. He probably acquired it from somebody else.
I figured since Vlad was creating a FAQ on tweaking the terminal driver, this would fit in.
If you think it's reasonable I will place this in a FAQ of it's own. I haven't created one yet.
yeah - I reckon, useful tip Mike
______________________________________________________________________
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.