What's the difference between WHEELUPMOUSE and WHEELINMOUSE?

Same with down/out…

So far as I can tell they refer to the same thing… anybody know? if they’re actually the same thing why do we have redundant event types?

I would think that Wheel up means the scroll wheel was rotated “up”, and down would mean the scroll wheel was rotated “down”.

Similarly I would think that wheel in mouse would mean the scroll wheel is depressed (like keydown) and wheel out means that the scroll wheel was just released (like keyup).

that isn’t the case, and it would be counter to how the other mouse events are used anyway (using a type+value combo). middlemouse+pressed does what you are describing

I can’t say whether or not that’s what is being used for in Blender, but there are mice available with lots of extra buttons and it’s possible that they could be remapped so the middle-click-down/up is separate from the wheel-click-down/up.

Obviously, this would be very niche to people with a remapped mouse and probably not suitable for defaults.

edit: I just thought of another use case. I remember seeing a drawing tablet with a dial in it, which presumably functions as the mouse wheel and the button on the pen/stylus acts as a middle button - so it does make sense that these would be separate user inputs.

It’s real/physical direction and UI direction that depends on the “Invert Zoom Direction” preference.

Or something like that. That’s what I’m guessing.

  /* defaults from ghost */
  WHEELUPMOUSE = 0x000a,
  WHEELDOWNMOUSE = 0x000b,
  /* mapped with userdef */
  WHEELINMOUSE = 0x000c,
  WHEELOUTMOUSE = 0x000d,
  switch (kmitype) {
    case WHEELOUTMOUSE:
      return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
    case WHEELINMOUSE:
      return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
  }
  prop = RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
  RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
2 Likes

Okay now that makes a lot more sense, thanks for digging that up. It’s essentially an alias that ensures the user preference is followed… I remember there was one for ‘selectmouse’ in the early 2.8 days but it looks like it’s been phased out, I wonder if this is also a vestigial keymap item type that needs deprecation?

edit: here’s the diff that removed SELECTMOUSE and other mouse aliases.