|
Post by yiannis on Nov 19, 2020 21:25:26 GMT
Hi
Is there a way to save the button name that was pressed on a keyboard? I do not mean to save 1 or 2 but the actual button e.g. "e", "r", "g" e.t.c. Importantly, I do not want to do it via STATUS i.e. if STATUS == 1 then the button that was pressed was "e".
Thank you in advance.
|
|
|
Post by matia on Nov 26, 2020 14:40:32 GMT
Hmm,
I think maybe you are looking for the system variable KEYPRESSED. When you tell Psytoolkit that it should save this variable, I think you'll get the answer you're looking for. Haven't tried it at this moment, but I have a vague memory that I was searching for it some time ago.
Hope this helps, best, Matia
|
|
|
Post by yiannis on Nov 27, 2020 17:35:09 GMT
Thanks matia for your suggestion. Unfortunately it did not work. It appears KEYPRESSED is for the cedrus response box only.
|
|
|
Post by matia on Nov 30, 2020 16:35:48 GMT
Dear yiannis, I have used the function KEYPRESSED without cedrus keyboard. But, you are right, this is not as straightforward Here is how I have done it: task Name table Table1 keys 1 2 3 4 5 6 7 a s d #yiannis, I list every possible key that can be pressed, I know its not elegant but it works, u should probably show bitmap scale 0 200 #define every key from the keyboard... note that I had to define a key in the table (but it doesn't matter to me show bitmap @2 @3 @4 #is it categorized as correct or not, I'll handle it during data analysis readkey @5 10000 # For example, I defined correct key to be 4 but I could have easily said its the key a save TABLEROW @1 RT KEY KEYPRESSED #and you write you want KEYPRESSED variable clear Hope this helps, best, Matia
|
|
|
Post by PsyToolkit on Dec 3, 2020 9:57:42 GMT
There is no direct way to do this. Why do you need it?
|
|