Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

How can I assign Keyboard keys to colours?

2 visualizzazioni (ultimi 30 giorni)
Barbara Fiorani
Barbara Fiorani il 27 Ott 2020
Chiuso: Walter Roberson il 29 Ott 2020
Hi,
I need to assign colours to Kb names as I am creating a stroop task script with Psychtoolbox.
This is a part of my script:
WordList = {'blanket', 'garage', 'shampoo', 'handle', 'sofa', 'curtain', 'switch', 'bathroom', 'vase', 'hallway', 'duster', 'lounge'};
rgbColors = [1 0 0; 0 1 0; 0 0 1];
rng('shuffle')
%Improve portability of the code acorss operating systems
KbName('UnifyKeyNames');
% Specify key names of interest
activeKeys = [KbName('LeftArrow') KbName('RightArrow') KbName('UpArrow') KbName('Space')];
% Restrict the keys for keyboard input to the keys we want
RestrictKeysForKbCheck(activeKeys);
% Suppress echo to the command line for keypresses
ListenChar(2);
%Assign Kb to colours ??????????
How can i pair the Kb with colours? For example, if it appear a word in yellow the participant has to press Kb 'Uparrow' and so forth.

Risposte (0)

Questa domanda è chiusa.

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by