Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Only register mouse scroll when key is held down?

Discussion in 'Input System' started by spiralogy, Jul 7, 2020.

  1. spiralogy

    spiralogy

    Joined:
    Oct 10, 2013
    Posts:
    11
    Hi all--just jumping into the new input system and I'm having a hell of a time finding out whether it's possible to set up the action map/bindings in such a way that the player can scroll the mousewheel--but only when a modifier key is pressed, such as CTRL. I see that there is a modifier with one button template, but can someone tell me whether it's possible to set it up, so instead of a button, it will register the mousewheel scrolling? if this is possible, is there an example or procedure I can look at to figure this out?

    Obviously I can just take the mousescroll event and then check in the callback to see if CTRL is pressed, but I'd prefer not to do that, since it seems to defeat the purpose of the new input system. Thanks!
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
  3. spiralogy

    spiralogy

    Joined:
    Oct 10, 2013
    Posts:
    11