Add isKeypress to emu and fix docs

This commit is contained in:
Thomas Edvalson
2015-12-07 23:19:52 -05:00
parent 8f3c4ed2a7
commit 36b81dcd9b
3 changed files with 7 additions and 6 deletions
+1 -5
View File
@@ -126,7 +126,7 @@ private:
///
/// Usage example:
/// \code
/// if (cpp3ds::Keyboard::isKeyPressed(cpp3ds::Mouse, cpp3ds::Keyboard::Left))
/// if (cpp3ds::Keyboard::isKeyPressed(cpp3ds::Keyboard::Left))
/// {
/// // move left...
/// }
@@ -134,10 +134,6 @@ private:
/// {
/// // move right...
/// }
/// else if (cpp3ds::Keyboard::isKeyPressed(cpp3ds::Keyboard::Escape))
/// {
/// // quit...
/// }
/// \endcode
///
/// \see cpp3ds::Joystick, cpp3ds::Touch
+1 -1
View File
@@ -16,7 +16,7 @@ bool Keyboard::isKeyDown(Key key) {
////////////////////////////////////////////////////////////
bool Keyboard::isKeyPressed(Key key) {
return (m_keysPressed& static_cast<u32>(key));
return (m_keysPressed & static_cast<u32>(key));
}
////////////////////////////////////////////////////////////
+5
View File
@@ -7,6 +7,11 @@ namespace cpp3ds {
float Keyboard::m_slider3d = 0;
float Keyboard::m_sliderVolume = 0;
////////////////////////////////////////////////////////////
bool Keyboard::isKeyDown(Key key) {
return isKeyPressed(key);
}
////////////////////////////////////////////////////////////
bool Keyboard::isKeyPressed(Key key) {
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));