Note that there are some explanatory texts on larger screens.

plurals
  1. POget time when user presses the key
    primarykey
    data
    text
    <p>I'll really appreciate it, if someone could help me out, I've been stuck on this problem for a few days, google, and other stackoverflow answers just doesn't seem to help.</p> <p>I have a web application that has an analog clock, from the clock I need to be able to get the time when the user presses the keyboard and compare that to the time they entered, I can get the time they entered through a form but I'm having trouble understanding how I can get the actual keypress time.</p> <p>Just to make sure that I'm on the right track, will I be able to put in a for loop into each task page for example: </p> <pre><code> var i = 0; for (i = 0; i &lt; 40; i ++){ //Add user input from form into an array //Add actual key press time in an array //Show next task link after the 40 trials are complete document.getElementById('nextTask').style.visibility="visible"; document.getElementById('nextTask').style.display="block"; } </code></pre> <p>There are 120 trials, in 3 separate tasks.</p> <p>1 of them has no sound. </p> <p>The other 2 has sound, but only 50% and 75% of the time a beep will occur and at other times it wont.. (I'm still struggling on that part.. but I'll tackle that later lol.)</p> <p>One last note, would I be able to run 40 trials using just one webpage, or would I have to create 40 X 3 separate pages, for the whole task. </p> <p>I created a JSFiddle, I'm still new to the whole idea, so let me know if I've made a mistake. <a href="http://jsfiddle.net/StrangeLondoner/ymXeG/" rel="nofollow">http://jsfiddle.net/StrangeLondoner/ymXeG/</a> </p> <p>The clock stops after a random number of milliseconds, the two keys to press are s and k. </p> <p>I'd like to thank you for your time reading this question and hopefully helping me get a solution somehow. </p> <p><strong>Finished</strong></p> <p>Hey guys, thanks for your input. I thought I'd let you guys know what I did, and if anyone else is searching for a similar answer. It may be a little primitive, but I created an identical counter, and ran simultaneously with the the clock, I know perforamance wise this isn't ideal, but I guess this will have to do until I come up with a better solution. I have to get it working somehow I suppose. </p> <p>Thanks Anyway. I'll update this if I can somehow find a better solution.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload