mirror of
https://github.com/encounter/cpp3ds.git
synced 2026-03-30 11:04:22 -07:00
Add isKeypress to emu and fix docs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user