mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Hopefully fixed waking up from sleep with axes.
This commit is contained in:
parent
0d7ac5a10a
commit
dc50170370
|
@ -1,3 +1,6 @@
|
|||
March 25, 2013
|
||||
-Hopefully fixed waking up from sleep with axes.
|
||||
|
||||
March 19, 2013
|
||||
-Finally added a "dim" or sleep mode. Change behavior with "--dimtime [positive integer time in seconds]", with 0 for off.
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ void InputManager::unregisterComponent(GuiComponent* comp)
|
|||
}
|
||||
}
|
||||
|
||||
void InputManager::processEvent(SDL_Event* event)
|
||||
InputManager::InputButton InputManager::processEvent(SDL_Event* event)
|
||||
{
|
||||
bool keyDown = false;
|
||||
InputButton button = UNKNOWN;
|
||||
|
@ -190,6 +190,8 @@ void InputManager::processEvent(SDL_Event* event)
|
|||
{
|
||||
inputVector.at(i)->onInput(button, keyDown);
|
||||
}
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
void InputManager::loadConfig()
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace InputManager {
|
|||
//enum for identifying input, regardless of configuration
|
||||
enum InputButton { UNKNOWN, UP, DOWN, LEFT, RIGHT, BUTTON1, BUTTON2, MENU, SELECT, PAGEUP, PAGEDOWN};
|
||||
|
||||
void processEvent(SDL_Event* event);
|
||||
InputButton processEvent(SDL_Event* event);
|
||||
|
||||
extern std::vector<GuiComponent*> inputVector;
|
||||
extern SDL_Event* lastEvent; //mostly for GuiInputConfig
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "AudioManager.h"
|
||||
#include "platform.h"
|
||||
#include "Log.h"
|
||||
#include "InputManager.h"
|
||||
|
||||
#ifdef _RPI_
|
||||
#include <bcm_host.h>
|
||||
|
@ -180,10 +181,12 @@ int main(int argc, char* argv[])
|
|||
case SDL_JOYBUTTONUP:
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
sleeping = false;
|
||||
timeSinceLastEvent = 0;
|
||||
case SDL_JOYAXISMOTION:
|
||||
InputManager::processEvent(&event);
|
||||
if(InputManager::processEvent(&event) != InputManager::UNKNOWN)
|
||||
{
|
||||
sleeping = false;
|
||||
timeSinceLastEvent = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_QUIT:
|
||||
|
|
Loading…
Reference in a new issue