This article applies to:
E-Prime 3.0
E-Prime 2.0
E-Prime 1.x
Detail
This sample demonstrates the methods used to access the state of a keyboard key or a mouse button in real time (as well as the state of input for other PST response devices).
Abstract
The InputDevice.History property holds information about all of the responses received by the corresponding input device (e.g., Keyboard, Mouse, Chronos, SRBox, etc.) since the start of the experiment. Using the InputDevice.History method, the current state of a key or button can be assessed via InLine script.
This sample assesses the state of the 'Q' key and the spacebar via the Keyboard.History property. During each trial, a message (i.e., 'Checking the state of the keys now…') is presented. Immediately following this message, InLine script is used to check the current state of the keys. Feedback about each key is then presented.
This sample can be modified to assess the state of other keyboard keys or the buttons from other devices as well. In the 'CheckState' InLine object, change the parameters sent to the GetLastState and/or GetLastResponseData functions. For example, to get the state of SRBox button '3', you would use:
nLastState = GetLastState(“3”, SRBox)
Any other device must first be added to the experiment via the Experiment Object’s Properties pages.
Comments
0 comments
Please sign in to leave a comment.