Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation - Configurable keyboard and gamepad controls #6506

Open
notskm opened this issue Jun 10, 2023 · 1 comment
Open

Navigation - Configurable keyboard and gamepad controls #6506

notskm opened this issue Jun 10, 2023 · 1 comment
Labels
inputs nav keyboard/gamepad navigation

Comments

@notskm
Copy link

notskm commented Jun 10, 2023

Version/Branch of Dear ImGui:

Version: 1.89.6
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_sdl2.cpp + imgui_impl_sdlrenderer2.cpp
Compiler: MSVC, clang, gcc
Operating System: Windows 10, Ubuntu

My Issue/Question:

It is currently possible to navigate using a gamepad or a keyboard. As far as I can tell, there is no way to rebind the buttons/keys to specific actions. For example, the X button on an Xbox controller opens the menu to navigate between windows. Personally, I believe the "view button" (the button with the two squares) makes more sense for my use-case. As for the keyboard, we currently navigate between GUI elements using the arrow keys. It would be nice if we could navigate rebind this action to WASD instead.

To sum up, all keybinds and gamepad controls should be configurable.

@ocornut ocornut added the nav keyboard/gamepad navigation label Jun 12, 2023
@ocornut
Copy link
Owner

ocornut commented Jun 12, 2023

In the earlier version we had an indirection (in the form of named ImGuiNavInput_ enum) which was initially intended to do that. Over time I realized it was too difficult to full-fill, there are too many subtleties in nav controls, and user application may need to rely on some of that knowledge. I decided to remove that indirection and things became simpler.

I don't intend to provide full rebind but improvements are possible. For example using back/view to open a modal version of the ctrl+tab switcher may be possible if it was opt-in. But I would encourage you to try get accustomed to those controls.
Depending on exact needs and your user base you might be able to merge WASD keys into Arrow keys (using a technique similar to this post #5723 (comment)).

There is a distinct need to leave at least one button unused in default setup to facilitate user app providing a way to "return" back to game/app controls.

@ocornut ocornut added the inputs label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inputs nav keyboard/gamepad navigation
Projects
None yet
Development

No branches or pull requests

2 participants