Check for modifiers when WindowScrollWheelFcn is called
Afficher commentaires plus anciens
Hi all,
I was wondering if it possible to check if a user has a modifier key (i.e. ctrl or alt) pressed when the WindowScrollWheelFcn is called on a figure?
I want to assign two different behaviours to the WindowScrollWheelFcn depending on whether or not a specific key is pressed.
Here's some pseudo code, to give the general idea what I want.
function fWindowScrollWheelFcn(hObject, eventdata)
modifiers = get(gcf,'currentModifier');
ctrlIsPressed = ismember('control',modifiers);
if ctrIsPressed
% Behaviour #1
else
% Behaviour #2
end
end
When I try this, the get function returns an empty cell array.
Thanks!
Ricardo
Réponses (0)
Catégories
En savoir plus sur Desktop dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!