Skip to content

Pressing Alt+Shift (or Shift+Alt) will clear the focus when using NavEnableKeyboard #4439

@0x416c69

Description

@0x416c69

Alt+Shift (or Shift+Alt) combination is the default shortcut for switching your keyboard language on win32.
This is very frustrating when you're typing inside an InputText widget and you want to change your keyboard language and then your input no longer has the focus.

There should be a check for the shift key not being held while checking for the KeyAlt.

Adding these lines to

imgui/imgui.cpp

Line 9129 in c7529c8

worked for me:

if (g.NavWindowingToggleLayer && io.KeyShift)
    g.NavWindowingToggleLayer = false;

At first I tried replacing the code in

imgui/imgui.cpp

Line 9123 in c7529c8

if (io.KeyAlt && !io.KeyCtrl)

to:

if (io.KeyAlt && !io.KeyCtrl && !io.KeyShift)

but that only fixed the problem when you held shift key first and then pressed the alt key. (The problem was still there by holding the alt key first and then pressing the shift key for some reason, both combinations are correct)

If the code that I use to solve this problem is correct and approved I'll go ahead and make the PR.

(I'm also not sure about mac or other operating systems but if this is exclusive to win32 maybe we can just put it inside a macro check)

Metadata

Metadata

Assignees

No one assigned

    Labels

    navkeyboard/gamepad navigation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions