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

Arrow KeyCodes in OnGUI always accompanied by EventModifiers.FunctionKey?

Discussion in 'Immediate Mode GUI (IMGUI)' started by SonicBloomEric, Jul 23, 2015.

  1. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    1,085
    In optimizing our extension's input handling, I noticed that arrow keys:
    KeyCode.UpArrow
    KeyCode.DownArrow
    KeyCode.LeftArrow
    KeyCode.RightArrow
    all come with the Event.current.modifiers set to EventModifiers.FunctionKey by default. I've currently verified that this happens on OSX (MacBook Pro) with Unity 4.5.5 and 4.6.7 and Windows 8.1 (VirtualBox) with Unity 4.5.5.

    Is this the expected functionality? If so, anyone know why are arrow keys defined as Function Keys?
     
  2. zwcloud

    zwcloud

    Joined:
    Mar 15, 2016
    Posts:
    377
    SonicBloomEric likes this.
  3. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    1,085
    Roughly 1.5 years later! Thanks so much for pointing this out! Super helpful.