raylib-extras/rlImGui-cs

Problem with 'io.KeysData'

Closed this issue · 2 comments

For me this line crashes because there is an 'index out of range exception'.

foreach (var keyItr in RaylibKeyMap)
    io.KeysData[(int)keyItr.Value].Down = (byte)(Raylib.IsKeyDown(keyItr.Key) ? 1 : 0);

I figured that this is offset value is needed. It worked for me fine, text input is OK.
https://github.com/ocornut/imgui/blob/e265610a0c4143b9abc64c50a3950ddcd0243622/imgui.h#L1425


foreach (var keyItr in RaylibKeyMap)
	io.KeysData[(int)(keyItr.Value - ImGuiKey.KeysData_OFFSET)].Down = (byte)(Raylib.IsKeyDown(keyItr.Key) ? 1 : 0);

That code is not needed and a holdover from the previous key input system. It has been removed.

OK, it looks like you updated it. Thanks.