mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15: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 "resources/Font.h"
|
||||
#include "Renderer.h"
|
||||
#include "PowerSaver.h"
|
||||
|
||||
enum CursorState
|
||||
{
|
||||
|
@ -191,6 +192,8 @@ protected:
|
|||
|
||||
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
|
||||
if(velocity == 0 && mScrollVelocity != 0)
|
||||
onCursorChanged(CURSOR_STOPPED);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "guis/GuiDetectDevice.h"
|
||||
#include "Window.h"
|
||||
#include "Renderer.h"
|
||||
#include "PowerSaver.h"
|
||||
#include "resources/Font.h"
|
||||
#include "guis/GuiInputConfig.h"
|
||||
#include "components/TextComponent.h"
|
||||
|
@ -74,9 +75,12 @@ void GuiDetectDevice::onSizeChanged()
|
|||
|
||||
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)
|
||||
{
|
||||
// cancel configuring
|
||||
PowerSaver::resume();
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
|
@ -109,6 +113,7 @@ void GuiDetectDevice::update(int deltaTime)
|
|||
{
|
||||
if(mDoneCallback)
|
||||
mDoneCallback();
|
||||
PowerSaver::resume();
|
||||
delete this; // delete GUI element
|
||||
}
|
||||
else
|
||||
|
@ -121,6 +126,7 @@ void GuiDetectDevice::update(int deltaTime)
|
|||
{
|
||||
// picked one!
|
||||
mWindow->pushGui(new GuiInputConfig(mWindow, mHoldingConfig, true, mDoneCallback));
|
||||
PowerSaver::resume();
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue