We are often going to be collecting responses in our experiments using the keyboard. When using Psychtoolbox, we will use a system in which each key has a unique code.
For instance, the key j
has a code of 13.
We use the KbName()
function to retrieve either the code associated with a letter:
KbName('j')
the letter associated with a code:
KbName(13)
By default, different operating systems have different key codes. We will "unify" them across operating systems using the KbUnifyNames
when setting the parameters for our experiments.