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

Fix ImGui keyboard event not being handled correctly #1148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Minoost
Copy link
Contributor

@Minoost Minoost commented Mar 3, 2023

This addresses the issue where io->WantCaptureKeyboard or ImGui.IsKeyPressed does nothing unless io.WantTextInput is also set.

Changes in ImGuiScene are also needed. For that, please check out this PR.

Clips

Current behavior After 4ad07f4
o.mp4

(Notice WantCaptureKeyboard does nothing)

f1.mp4
Issue after 4ad07f4 After d8f6de5 (final fix)
p1.mp4
f2.mp4

Minoost added 3 commits March 3, 2023 12:40
Polling `KeyState` buffer and writing zeros as needed was common method
to implement hotkey feature. This, however, can cause certain actions
like running being abruptly interrupted or misbehaving (processing as if it
was pressed again despite the user never released it) due to the nature
of key state buffer.

This commit introduces `SimulatedKeyState` and `KeyCapture` services.
`SimulatedKeyStates` roughly simulates how the game calculates key states
and `KeyCapture` uses their own rules to decide when to pass this value
as inputs to the game.
This is a last minute change. I believe there's no harm in exposing this
service to plugins, but who knows...
@Minoost Minoost changed the title Fix ImGui keyboard event Fix ImGui keyboard event not being handled correctly Mar 3, 2023
@goaaats goaaats added the needs api bump Held for the next API bump label Mar 11, 2023
@KazWolfe KazWolfe added this to the Dalamud API v9 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs api bump Held for the next API bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants