Pressing “Space” to play/pause in editor is inconsistent

Slate Forums Support Pressing “Space” to play/pause in editor is inconsistent

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2595
    dgoyette
    Participant

    I’ve been running into an issue where pressing Space to play/pause in the editor doesn’t consistently work. Looking at the code, that feature only fires as long as something in the editor doesn’t have keyboard focus. (GUIUtility.keyboardControl needs to be 0). However, there are some UI elements that bizarrely get keyboard focus upon being clicked. One example is the Animator Curve editor.

    For example, if I click anywhere in this region, GUIUtility.keyboardControl will be set to something non-zero, and it’s actually kind of hard to clear that. Clicking on various other Animation Tracks won’t clear it. I need to click in certain specific parts of the UI to clear it.

     

    So, once I’ve clicked this, Space bar won’t play/pause anymore until I click on something else. I haven’t figured out a way to avoid having the Animation Curve editor grab focus like this. Any thoughts?

    #2596
    dgoyette
    Participant

    Looks like pasted-in images still don’t work in the forums, so here’s the image I was referring to above, as an attachment.

    Attachments:
    You must be logged in to view attached files.
    #2598
    Gavalakis
    Keymaster

    Hello,

    Indeed. The check of GUIUtility.keyboardcontrol being 0, is done because if a UI control has focus, pressing spacebar will trigger the UI control (e.g. a checkbox will be checked/unckecked, or a textfield will write the space character etc). I will look at this and see how possible it is to bypass that and have the spacebar shortcut for play always work. Thank you 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.