Check for modifiers when WindowScrollWheelFcn is called
Show older comments
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
Answers (0)
Categories
Find more on Desktop in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!