#1
|
|||
|
|||
key duration
Hi,
How to get duration between a key down and key up during task? During watching some VR scene (or VR avatar) for 5 sec, I want to measure participants' key-press duration (how long participant presses the key). viztask.waitKeyUp may be suitable, but it terminates the VR scene showing. |
#2
|
|||
|
|||
Hey Roy,
If you don't want yield statements terminating your scene, I would suggest using the onkeydown and onkeyup function in the vizact library. Use the respective up and down functions to log the time using viz.tick() in global variables and then find the difference to calculate the elapsed time. This should occur without causing any disruption in the scene being run. Hope it helps. Best, Kenneth |
#3
|
|||
|
|||
Hi Kenneth,
Please see the codes which use the onkeydown&up methods as below. Code:
def keyDown(): global start start = viz.tick() print ('key pressed: ' + str(start)) def keyUp(): global start, end, keyTime end = viz.tick() keyTime = end - start print ('key released: ' + str(end)) print ('key duration: ' + str(keyTime)) The key duration should be calculated by the first keydown time (19.2442121). How to fix it? Quote:
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
logging duration and order of grab/gaze | zumbay | Vizard | 1 | 11-17-2016 04:48 PM |
Avatar eye contact with user as it moves | Ducky | Vizard | 1 | 03-01-2013 12:23 PM |
Randomly and Continuously Change Avatar's Face Texture | Karla | Vizard | 4 | 08-22-2008 12:14 PM |
Problem with getting duration of walkto() | ghazanfar | Vizard | 4 | 03-23-2007 09:17 AM |