
HarryAchterdeur
Novice
Sep 19, 2012, 12:26 AM
Post #1 of 3
(935 views)
|
|
I can't figure out how to change my input parameters
|
Can't Post
|
|
Hello all, I am really not sure if you can help me, but I thought lets give it a shot. I've been making a time related typ program to research typing behaviour. So I have an input function where people can write, and automatically when enter is pressed it goes to the following function. But I want my script to go to the next function when spacebar is pushed. So in my script, that covers my input section, I want a function like: If 'spacebar' is pressed then go on to the next function. Could you please help me? use Time::HiRes; my $start = [ Time::HiRes::gettimeofday( ) ]; Print "Begin typing when you are ready "; $Tijd = <>; #here my input comes to life print "This is what you have typed $Tijd"; my $elapsed = Time::HiRes::tv_interval( $start ); print "Total secondes you needed to create this sentence: $elapsed seconds!\n"; ...................................................................................... Now I want the input from $Tijd to go out of $start when spacebar is pushed. So when you make a sentence and you press spacebar the function will be aborted and go to the next one. The goal of this is to brake sentenses into words. So I can see what time is elapsed when certain words are typed. Hopefully you can help me. Grtz. Harry
|