raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming

Home Page:http://www.raylib.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[core] rlImGUI needs a way to consume input

albertvaka opened this issue · comments

Issue description

When you click inside an ImGui window, that click should be "consumed" by ImGUI and not delivered to the app (ie: IsMouseButtonPressed() should return false after that, GetMousePosition() should stop updating).

The current Raylib API doesn't allow this.

Corresponding issue in rlImGui: raylib-extras/rlImGui#63

commented

@JeffM2501 you implemented rlImGUI example, did you find some way to address this issue?

This is no how ImGui works. you are supposed to check ImGui if it wants the device input or not. The IO has want key and want mouse fields. If ImGui wants the device, it's your job not to check the underlying platform. It's not the job of rlImGui to change event states in the underlying platform. ImGui does not assume that the underlying platform even has events.
This is a user error issue not a missing feature in raylib.

Closing this one so the conversation is only in the rlImGui issue.

@albertvaka I have a working version of rlImGui but I don't know if it suffers from this disease...