Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How can I assign Keyboard keys to colours?

2 Ansichten (letzte 30 Tage)
Barbara Fiorani
Barbara Fiorani am 27 Okt. 2020
Geschlossen: Walter Roberson am 29 Okt. 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.

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by