TextProxy: key-code fallback waits a few frames for the TextBox (fixes doubled typing)
Build & Release / build (push) Canceled after 0s
Build & Release / build (push) Canceled after 0s
This commit is contained in:
1 parent
4bee0e493a
commit
e1c4ea96d7
4 files changed
+24
-8
No files matched your search
@@ -379,9 +379,17 @@ function ImGui_ImplRoblox_NewFrame()
|
||||
BackendData.DeleteKeySeen = false
|
||||
|
||||
local pending = BackendData.PendingChars
|
||||
if #pending > 0 then
|
||||
if not used_proxy_text then for _, c in ipairs(pending) do io:AddInputCharacter(c) end end
|
||||
table.clear(pending)
|
||||
if used_proxy_text then
|
||||
table.clear(pending) -- the proxy delivered the text: the key-code copies would double it
|
||||
BackendData.PendingAge = 0
|
||||
elseif #pending > 0 then
|
||||
-- the TextBox's Text can update a frame or two after InputBegan: wait before falling back to key codes
|
||||
BackendData.PendingAge = (BackendData.PendingAge or 0) + 1
|
||||
if not ProxyFocused or BackendData.PendingAge > 3 then
|
||||
for _, c in ipairs(pending) do io:AddInputCharacter(c) end
|
||||
table.clear(pending)
|
||||
BackendData.PendingAge = 0
|
||||
end
|
||||
end
|
||||
|
||||
-- Tiles Active while over imgui, so Roblox stops passing clicks/wheel to the game (camera zoom etc.)
|
||||
|
||||
Reference in new issue
Block a user