How to Map Mouse Buttons to Pan and Zoom in GIMP

Customizing mouse inputs in GIMP allows you to streamline your workflow by assigning essential navigation controls, such as panning across the canvas and zooming in or out, directly to your preferred mouse buttons. This guide outlines how to use GIMP's built-in Input Controllers to assign these actions, as well as how to use mouse utility software for advanced multi-button mice to achieve seamless canvas navigation.

Method 1: Using GIMP's Built-in Input Controllers

GIMP includes an internal input controller system that allows you to bind mouse wheel events and standard button combinations to specific view actions.

  1. Open Preferences:
    • On Windows/Linux: Go to Edit > Preferences.
    • On macOS: Go to GIMP > Preferences.
  2. Navigate to Input Controllers:
    • In the left sidebar of the Preferences window, expand Input Devices and select Input Controllers.
  3. Enable the Main Mouse Wheel Controller:
    • Under the Active Controllers column, check if Main Mouse Wheel is listed.
    • If it is in the Available Controllers column instead, select it and click the right-arrow button to move it to Active Controllers.
  4. Assign Pan and Zoom Actions:
    • Double-click Main Mouse Wheel in the Active Controllers column to open the configuration dialog.
    • You will see a list of events such as Scroll Up, Scroll Down, and variants with modifiers (e.g., Alt + Scroll Up, Shift + Scroll Up).
    • Select an event to reassign:
      • For Zooming: Select an event, click Edit, search for View Zoom In (or view-zoom-in), and assign it. Repeat with View Zoom Out (or view-zoom-out) for the reverse direction.
      • For Panning: Search for Scroll Canvas Up, Scroll Canvas Down, Scroll Canvas Left, or Scroll Canvas Right (under the view-scroll-* actions) to map them to directional scroll actions.
    • Click OK to save the changes.

Method 2: Mapping Extra Mouse Buttons (Side Buttons / Mouse 4 & 5)

GIMP does not natively detect secondary side buttons (like Button 4 and Button 5) within its internal controller mapping interface. The most effective way to map these buttons to pan and zoom is through your mouse configuration software (e.g., Logitech G HUB, Razer Synapse, Corsair iCUE, or generic utilities like X-Mouse Button Control on Windows).

Setting Up Canvas Panning:

In GIMP, holding the Middle Mouse Button (Scroll Wheel Click) or holding Spacebar + Left Click pans the canvas.

  1. Open your mouse configuration software.
  2. Select your mouse and locate the side button you want to use for panning.
  3. Remap that button to perform one of the following:
    • Middle Mouse Click: Allows you to click and drag to pan anywhere on the canvas.
    • Keystroke (Spacebar): Holding the button will switch the cursor to the Move/Pan tool while held down, allowing you to drag with the primary mouse button.

Setting Up Canvas Zooming:

In GIMP, holding Ctrl while scrolling the mouse wheel zooms in and out.

  1. In your mouse configuration software, locate the buttons you want to map to zoom controls.
  2. Assign the buttons to simulate the following keystrokes:
    • Zoom In: Map to a macro for Ctrl + Mouse Wheel Up (or the + key on the main keyboard).
    • Zoom Out: Map to a macro for Ctrl + Mouse Wheel Down (or the - key on the main keyboard).
  3. Apply the settings. If your software supports application-specific profiles, assign these mappings specifically to gimp.exe so your standard mouse behavior remains unchanged in other applications.