Changed the love.keypressed and love.keyreleased event callbacks to be love.keypressed(key, scancode, isrepeat) and love.keyreleased(key, scancode). Added love.keyboard.isScancodeDown. Resolves issue #993.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-16 17:10:03 -04:00
parent cce995146f
commit 5c1e6014cc
6 changed files with 98 additions and 24 deletions
+5 -1
View File
@@ -46,7 +46,8 @@ public:
void setKeyRepeat(bool enable);
bool hasKeyRepeat() const;
bool isDown(Key *keylist) const;
bool isDown(const std::vector<Key> &keylist) const;
bool isScancodeDown(const std::vector<Scancode> &scancodelist) const;
Key getKeyFromScancode(Scancode scancode) const;
Scancode getScancodeFromKey(Key key) const;
@@ -54,6 +55,9 @@ public:
void setTextInput(bool enable);
bool hasTextInput() const;
static bool getConstant(Scancode in, SDL_Scancode &out);
static bool getConstant(SDL_Scancode in, Scancode &out);
private:
// Whether holding down a key triggers repeated key press events.