Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By default, Unity's keyboard navigation for buttons seems to check for GetButton rather than GetButtonDown--if a menu has 5 items and I hold the down arrow, it'll scroll very quickly to the bottom.

This feels awkward; it would make more sense to check for GetButtonDown and only move 1 space per input. However, I can't find any option to let me change that. Any ideas or workarounds?

share|improve this question

Sadly there's currently no way to make Unity's keyboard navigation to use GetButtonDown instead of GetButton.

However, EventSystem -> Standalone Input Module exposes an Input Actions per Second variable.

The default value is 10 seconds.
If you change it to a lower value, like 3, you will slow down considerably the scroll to bottom speed.

Because picking a low value for this setting will limit your in-game input, you might want to set different values in your menu and game scenes via code. http://docs.unity3d.com/ScriptReference/EventSystems.StandaloneInputModule.html

share|improve this answer
    
Hm, okay. But wouldn't that result in the game throwing out some inputs? – eternal Jun 15 '15 at 15:51
    
You are correct. For this reason, you might want to set different values for this setting (via code) in your menu and game scenes. – Mihai-Andrei Dinculescu Jun 15 '15 at 16:32
1  
It might make more sense to use StandaloneInputModule.repeatDelay and set it to somewhere between 0.5f-1.0f that way the User can tap the arrow key to navigate menu items like normal but holding it down won't immediately start scrolling rapidly. Setting this to a really high value would simulate using GetButtonDown since it wouldn't repeat unless the key was held down for a long period. – Jeremiah Leslie Jun 16 '15 at 6:52
    
repeatDelay sounds like it would work perfectly, but I can't seem to access it. My script is already using UnityEngine.EventSystems, but when I type in the class StandaloneInputModule, I don't get any of its variables. – eternal Jun 16 '15 at 8:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.