Is there a way to set keyboard shortcuts to toggle layers on/off while editing?
For example F1 will turn on /off my top layer in my table of contents, F2 will toggle the 2nd layer, ect.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
From Keyboard shortcuts in ArcMap these are the keyboard shortcuts available in ArcMap for use in the Table of Contents
Navigating the table of contents with the keyboard
- F3 or clicking inside the table of contents puts the keyboard focus on the table of contents so you can navigate and interact with it.
- ESC or clicking the map puts the keyboard focus on the map.
- HOME selects the first item in the table of contents.
- END selects the last item in the table of contents.
- PAGE UP or PAGE DOWN arrows move through the items in the table of contents.
- Left/Right arrows or the + and - keys expand or collapse selected items. They also toggle among the tabs at the bottom of the table of contents when they have keyboard focus.
- SPACE turns drawing of the selected layers on or off.
- CTRL+SPACE turns all the layers in the data frame on or off when a single layer is selected in the table of contents. If the selected layer is part of a group layer or a composite layer, such as an ArcIMS image service layer, all the members of that layer will be turned on or off. If multiple layers are selected, CTRL+SPACE works like SPACE by itself and toggles only the selected layers on or off.
- F2 renames the selected item.
- F12 or ENTER opens the selected item's properties dialog box. If the currently selected item is a heading, symbol, or label, the Layer Properties dialog box will open with the Symbology tab shown on top.
- SHIFT+F10 (or the Application key, if your keyboard has one) opens the shortcut menu for the selected item.
- Use SHIFT+F1 or F1 to obtain context help when an item has keyboard focus or when the properties dialog box tab or a table of contents tab is selected.
- F11 activates a selected data frame, or hold down ALT and click a data frame to activate it.
- When there are multiple data frames in the map, use CTRL+TAB to cycle through each data frame and activate it.
It doesn't appear that there is a way to selectively turn layers on/off using the keyboard, however you could use a combination of F3, Page Up, Page Down, and SPACE etc. to enter the TOC, move up and down, and turn on/off as required.
I wrote an AutoHotkey script for this. The first variant sent mouse clicks to the check boxes, but only works if you have the same layers in the same spot all the time.
My latest version uses the FindText utility (which searches for images and text) to select the layer in question, then send appropriate keystrokes (space- to activate or deactivate the layer, followed by home-reset the position in the table of contents).
I love using AHK because you can have global hotkeys and manipulate any program to year heart's content. Powerful stuff.