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