MATLAB Example - Keystroke Detection
Note: MATLAB R2007A or greater is required to run the code
Annotations
Raw Source
% Test code for keystrokes
% Initialize window is necessary
initializeWindow(0);
KeepGoing = true;
while KeepGoing == true
if checkKeyPress('g')
disp('g');
end
if checkKeyPress('b')
disp('b');
end
if checkKeyPress('q')
KeepGoing = false;
end
pause(0.01);
end