void handleUiInput(ref UiContext ui)
Handles input events and updates the microui context accordingly.