File Exchange

image thumbnail

Pre-R2012b Zoom Keyboard Shortcuts

version 1.1.0.1 (2.45 KB) by Mike Anthony
Enables use of r, v, 1, anf f as keyboard shortcut keys for zooming in Simulink

1 Download

Updated 01 Sep 2016

View Version History

View License

One of the significant changes in the updated editor windows in R2012b was a change in the shortcut keys in Simulink for zooming. In R2012b and later, zooming is controlled using the scroll-wheel on the mouse (or Ctrl+Scroll depending on your preferences). The keyboard shortcut keys for zooming were assigned to the much more standard zoom shortcut keys of Ctrl++ and Ctrl+-. However, these keyboard shortcuts more difficult to use with one hand on the keyboard and one hand on the mouse (a common practice for long-time Simulink users).
This function enables the use of the pre-R2012b keyboard shortcuts in R2012b and later:
r: zoom in
v: zoom out
1: Normal View (100%)
f: fit selected block(s) to window

This simply adds these shortcuts, and does not deactivate the use of Ctrl++, Ctrl+-, or the scroll wheel.

To apply the customization, from the .zip file extract the file sl_customization.m and put it somewhere on your MATLAB path. At the MATLAB command prompt, run sl_refresh_customizations. These customizations should then appear in the Simulink->View menu and the keyboard shortcuts should be active.

Note: for some reason the first few attempts to use this after registering the customization are very slow. However, it seems to then behave normally after that. I have not yet figured out why.

Cite As

Mike Anthony (2020). Pre-R2012b Zoom Keyboard Shortcuts (https://www.mathworks.com/matlabcentral/fileexchange/42298-pre-r2012b-zoom-keyboard-shortcuts), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Brian

Great work!
I finally upgraded past 2011b and was missing those R,F,V keys in simulink.
Minor bug: the schema.label for "Zoom to Fit" is wrong.

Tim Evans

I'm having a problem with the 'r' key not zooming in any farther than what I can get by pushing the 'f' key (looks like what Liangtao had mentioned). For more information, if you press ctrl++, you can continue to zoom in (which was also the default 2009b behavior), but 'r' will not continue to zoom.

It also doesn't work at all inside of locked libraries.

I can work around this by selecting other, smaller objects to zoom in on, but it'd be nice to have the full functionality back. Actually, it'd be nice if mathworks didn't totally ruin the interface without an option to use the previous one, but that's clearly asking too much.

Thanks!

Mike Anthony

Tan: if I understand your question correctly, I think the confusion comes from the use of sl_customization(cm). I should have made the instructions more clear, sorry about that.

You don't call sl_customization as a function. Instead, with this sl_customization.m on your MATLAB path, at the command prompt run the function: sl_refresh_customizations

See my comment below that has a link to the online documentation that further explains how sl_customization files work.

I hope that answers your question. Thanks!

Mike Anthony

Sorry, apparently the comments section here doesn't allow hyperlink code. This is the doc link:
http://www.mathworks.com/help/simulink/ug/registering-customizations.html?searchHighlight=sl_customization

tan

Hi, what input should i put under "cm"?

Mike Anthony

Hi Liangtao. Thanks for the feedback. Unfortunately I'm either not quite understanding your issue with 'r' or I'm not able to replicate the issue. For me, the 'r' key zooms in to any level of zoom up to the level that 'f' would zoom.

As I mentioned in the note above, the first few times you try to use these shortcut keys there can be a significant lag. Is it possible this is the issue you're seeing?

Is anyone else seeing the same issue as Liangtao?

Please let me know. Thanks!

Liangtao

I liked the shortcut key pre-2012B. Thanks for bringing them back.

One problem on the 'r' key. It does not zoom in more than 100% normal view (as 'f'). Any idea why?

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!