Skip to content

How to set the current keyboard focus. #1712

Open
@eriksintorn

Description

@eriksintorn

Hello,
Apologies if there is an obvious answer to this, but I cannot find it. In my game, I have an inventory represented by a number of buttons. When I press a specific key, focus is shifted to that window and I can use the keyboard to navigate to the button (item) I want to use, and it is nicely highlighted.

I am wondering if there is any way to set the current keyboard focus (the currently selected item/button) in code? I've obviously tried SetKeyboardFocusHere(), but that seems to only work on InputText and similar widgets, not buttons? Or am I doing something wrong?

Any help greatly appreciated, thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focusnavkeyboard/gamepad navigation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions