mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Handle longclick in PS:Instant mode
This commit is contained in:
parent
8e7ee6c931
commit
8d4a69cacf
|
@ -7,6 +7,7 @@
|
||||||
#include "components/ImageComponent.h"
|
#include "components/ImageComponent.h"
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
#include "PowerSaver.h"
|
||||||
|
|
||||||
enum CursorState
|
enum CursorState
|
||||||
{
|
{
|
||||||
|
@ -191,6 +192,8 @@ protected:
|
||||||
|
|
||||||
bool listInput(int velocity) // a velocity of 0 = stop scrolling
|
bool listInput(int velocity) // a velocity of 0 = stop scrolling
|
||||||
{
|
{
|
||||||
|
PowerSaver::setState(velocity == 0);
|
||||||
|
|
||||||
// generate an onCursorChanged event in the stopped state when the user lets go of the key
|
// generate an onCursorChanged event in the stopped state when the user lets go of the key
|
||||||
if(velocity == 0 && mScrollVelocity != 0)
|
if(velocity == 0 && mScrollVelocity != 0)
|
||||||
onCursorChanged(CURSOR_STOPPED);
|
onCursorChanged(CURSOR_STOPPED);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "guis/GuiDetectDevice.h"
|
#include "guis/GuiDetectDevice.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
#include "PowerSaver.h"
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
#include "guis/GuiInputConfig.h"
|
#include "guis/GuiInputConfig.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
|
@ -74,9 +75,12 @@ void GuiDetectDevice::onSizeChanged()
|
||||||
|
|
||||||
bool GuiDetectDevice::input(InputConfig* config, Input input)
|
bool GuiDetectDevice::input(InputConfig* config, Input input)
|
||||||
{
|
{
|
||||||
|
PowerSaver::pause();
|
||||||
|
|
||||||
if(!mFirstRun && input.device == DEVICE_KEYBOARD && input.type == TYPE_KEY && input.value && input.id == SDLK_ESCAPE)
|
if(!mFirstRun && input.device == DEVICE_KEYBOARD && input.type == TYPE_KEY && input.value && input.id == SDLK_ESCAPE)
|
||||||
{
|
{
|
||||||
// cancel configuring
|
// cancel configuring
|
||||||
|
PowerSaver::resume();
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -109,6 +113,7 @@ void GuiDetectDevice::update(int deltaTime)
|
||||||
{
|
{
|
||||||
if(mDoneCallback)
|
if(mDoneCallback)
|
||||||
mDoneCallback();
|
mDoneCallback();
|
||||||
|
PowerSaver::resume();
|
||||||
delete this; // delete GUI element
|
delete this; // delete GUI element
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -121,6 +126,7 @@ void GuiDetectDevice::update(int deltaTime)
|
||||||
{
|
{
|
||||||
// picked one!
|
// picked one!
|
||||||
mWindow->pushGui(new GuiInputConfig(mWindow, mHoldingConfig, true, mDoneCallback));
|
mWindow->pushGui(new GuiInputConfig(mWindow, mHoldingConfig, true, mDoneCallback));
|
||||||
|
PowerSaver::resume();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue