Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Return bool values from input handlers #2

Merged
merged 1 commit into from
Nov 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ImguiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bool ImguiManager::mouseWheelRolled(const OgreBites::MouseWheelEvent& arg)
{
ImGuiIO& io = ImGui::GetIO();
io.MouseWheel = Ogre::Math::Sign(arg.y);
return true;
return io.WantCaptureMouse;
}

bool ImguiManager::mouseMoved( const OgreBites::MouseMotionEvent &arg )
Expand All @@ -116,7 +116,7 @@ bool ImguiManager::mouseMoved( const OgreBites::MouseMotionEvent &arg )
io.MousePos.x = arg.x;
io.MousePos.y = arg.y;

return true;
return io.WantCaptureMouse;
}

// map sdl2 mouse buttons to imgui
Expand All @@ -140,7 +140,7 @@ bool ImguiManager::mousePressed( const OgreBites::MouseButtonEvent &arg)
{
io.MouseDown[b] = true;
}
return true;
return io.WantCaptureMouse;
}
bool ImguiManager::mouseReleased( const OgreBites::MouseButtonEvent &arg)
{
Expand All @@ -150,7 +150,7 @@ bool ImguiManager::mouseReleased( const OgreBites::MouseButtonEvent &arg)
{
io.MouseDown[b] = false;
}
return true;
return io.WantCaptureMouse;
}
bool ImguiManager::keyPressed( const OgreBites::KeyboardEvent &arg )
{
Expand All @@ -169,7 +169,7 @@ bool ImguiManager::keyPressed( const OgreBites::KeyboardEvent &arg )
io.AddInputCharacter((unsigned short)arg.keysym.sym);
}

return true;
return io.WantCaptureKeyboard;
}
bool ImguiManager::keyReleased( const OgreBites::KeyboardEvent &arg )
{
Expand All @@ -179,7 +179,7 @@ bool ImguiManager::keyReleased( const OgreBites::KeyboardEvent &arg )

ImGuiIO& io = ImGui::GetIO();
io.KeysDown[key] = false;
return true;
return io.WantCaptureKeyboard;
}
//-----------------------------------------------------------------------------------
void ImguiManager::renderQueueEnded(uint8 queueGroupId, const String& invocation,bool& repeatThisInvocation)
Expand Down