How to detect if a certain key is depressed in an InLine object?
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



How to detect if a certain key is depressed... Expand / Collapse
Author
Message
Posted 5/21/2012 3:12:04 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/13/2012 9:24:43 PM
Posts: 7, Visits: 23
We want to implement some pausing logic between trials. We want to be able to check to see if the INSERT button is in a depressed state. We want there to be minimum interruption (latency) incurred as a result of this check. Ideally, we would be able to execute a command from an InLine object and see if INSERT is depressed. Is this supported? If so, can you please provide a line of code as a sample?

We have tried creating a blank Text object and allowing {INSERT}. We tried setting this object's display time to something very small like 1ms or 5ms, but it seemed the INSERT key (pressed and held down by a user) was not detected. I don't know whether the polling interval for a key press check is longer than our duration, or whether the Text object is only looking for a KEYDOWN event during that interval.

Any ideas of how to implement this logic?

Doug Girard
President, Nirodha Software
doug@nirodhasoftware.com

Doug Girard
President, Nirodha Software
doug@nirodhasoftware.com

Post #6021
Posted 5/24/2012 7:01:42 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/13/2012 9:24:43 PM
Posts: 7, Visits: 23
Through my own messing around, I determined that the following code in an InLine object did the trick:

If Keyboard.GetKeyState("x") = ebStatePress Then

I just don't know how to get the non-alphanumeric keys to work, e.g. INSERT.


Doug Girard
President, Nirodha Software
doug@nirodhasoftware.com
Post #6034
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 5:39

Powered By InstantForum.NET v4.1.4 © 2013
Execution: 0.141. 10 queries. Compression Disabled.
 
Privacy | Terms of Use | Terms and Conditions | Legal Trademarks | Authorized Use | Quality Policy
Copyright 2013 Psychology Software Tools, Inc. All Rights Reserved
Email: Info@pstnet.com | Telephone: 412.449.0078 | Fax: 412.449.0079