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

Commit

Permalink
Merge pull request #2 from emersonknapp/master
Browse files Browse the repository at this point in the history
Return bool values from input handlers
  • Loading branch information
paroj authored Nov 21, 2018
2 parents 8e2acd8 + 9d1199f commit 06bbbc6
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 06bbbc6

Please sign in to comment.