2012-11-01 15:19:01 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 22:01:49 +00:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-10-01 07:36:43 +00:00
|
|
|
#include "Common/Input/InputState.h"
|
2020-10-04 21:24:14 +00:00
|
|
|
#include "Common/Render/DrawBuffer.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2020-10-04 18:48:47 +00:00
|
|
|
#include "Common/UI/View.h"
|
|
|
|
#include "Common/UI/ViewGroup.h"
|
2018-06-17 06:00:21 +00:00
|
|
|
#include "Core/CoreParameter.h"
|
2023-03-26 09:35:42 +00:00
|
|
|
#include "Core/HLE/sceCtrl.h"
|
2021-03-04 09:37:35 +00:00
|
|
|
#include "UI/EmuScreen.h"
|
2013-07-20 10:06:06 +00:00
|
|
|
|
2015-12-20 20:40:47 +00:00
|
|
|
class GamepadView : public UI::View {
|
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
GamepadView(const char *key, UI::LayoutParams *layoutParams);
|
2015-12-20 20:40:47 +00:00
|
|
|
|
|
|
|
bool Key(const KeyInput &input) override {
|
|
|
|
return false;
|
|
|
|
}
|
2021-02-22 00:38:02 +00:00
|
|
|
std::string DescribeText() const override;
|
2015-12-20 20:40:47 +00:00
|
|
|
|
|
|
|
protected:
|
2023-06-20 07:30:38 +00:00
|
|
|
std::string key_;
|
2015-12-20 20:40:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MultiTouchButton : public GamepadView {
|
2013-07-20 10:06:06 +00:00
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
MultiTouchButton(const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams)
|
|
|
|
: GamepadView(key, layoutParams), scale_(scale), bgImg_(bgImg), bgDownImg_(bgDownImg), img_(img) {
|
2013-07-20 10:06:06 +00:00
|
|
|
}
|
|
|
|
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2015-12-20 20:40:47 +00:00
|
|
|
void Draw(UIContext &dc) override;
|
|
|
|
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override;
|
2013-07-20 18:48:21 +00:00
|
|
|
virtual bool IsDown() { return pointerDownMask_ != 0; }
|
2013-07-20 12:05:07 +00:00
|
|
|
// chainable
|
|
|
|
MultiTouchButton *FlipImageH(bool flip) { flipImageH_ = flip; return this; }
|
2018-06-17 06:00:21 +00:00
|
|
|
MultiTouchButton *SetAngle(float angle) { angle_ = angle; bgAngle_ = angle; return this; }
|
|
|
|
MultiTouchButton *SetAngle(float angle, float bgAngle) { angle_ = angle; bgAngle_ = bgAngle; return this; }
|
2013-07-20 10:06:06 +00:00
|
|
|
|
|
|
|
protected:
|
2018-06-17 06:00:21 +00:00
|
|
|
uint32_t pointerDownMask_ = 0;
|
2013-10-09 20:15:56 +00:00
|
|
|
float scale_;
|
2013-07-20 10:06:06 +00:00
|
|
|
|
|
|
|
private:
|
2020-02-29 20:51:14 +00:00
|
|
|
ImageID bgImg_;
|
|
|
|
ImageID bgDownImg_;
|
|
|
|
ImageID img_;
|
2018-06-17 06:00:21 +00:00
|
|
|
float bgAngle_ = 0.0f;
|
|
|
|
float angle_ = 0.0f;
|
|
|
|
bool flipImageH_ = false;
|
2013-07-20 10:06:06 +00:00
|
|
|
};
|
|
|
|
|
2013-07-20 12:05:07 +00:00
|
|
|
class BoolButton : public MultiTouchButton {
|
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
BoolButton(bool *value, const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams)
|
|
|
|
: MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), value_(value) {
|
2013-07-20 12:05:07 +00:00
|
|
|
|
|
|
|
}
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2015-12-20 20:40:47 +00:00
|
|
|
bool IsDown() override { return *value_; }
|
2013-07-20 12:05:07 +00:00
|
|
|
|
2018-06-23 18:06:56 +00:00
|
|
|
UI::Event OnChange;
|
|
|
|
|
2013-07-20 12:05:07 +00:00
|
|
|
private:
|
|
|
|
bool *value_;
|
|
|
|
};
|
|
|
|
|
2013-07-20 10:06:06 +00:00
|
|
|
class PSPButton : public MultiTouchButton {
|
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
PSPButton(int pspButtonBit, const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams)
|
|
|
|
: MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) {
|
2013-07-20 10:06:06 +00:00
|
|
|
}
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2015-12-20 20:40:47 +00:00
|
|
|
bool IsDown() override;
|
2013-07-20 10:06:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int pspButtonBit_;
|
|
|
|
};
|
|
|
|
|
2015-12-20 20:40:47 +00:00
|
|
|
class PSPDpad : public GamepadView {
|
2013-07-20 10:06:06 +00:00
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
PSPDpad(ImageID arrowIndex, const char *key, ImageID arrowDownIndex, ImageID overlayIndex, float scale, float spacing, UI::LayoutParams *layoutParams);
|
2013-07-20 10:06:06 +00:00
|
|
|
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2015-02-02 23:11:51 +00:00
|
|
|
void Draw(UIContext &dc) override;
|
|
|
|
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override;
|
2013-07-20 10:06:06 +00:00
|
|
|
|
|
|
|
private:
|
2013-07-20 10:54:33 +00:00
|
|
|
void ProcessTouch(float x, float y, bool down);
|
2020-02-29 20:51:14 +00:00
|
|
|
ImageID arrowIndex_;
|
|
|
|
ImageID arrowDownIndex_;
|
|
|
|
ImageID overlayIndex_;
|
2013-07-20 10:54:33 +00:00
|
|
|
|
2013-07-20 18:48:21 +00:00
|
|
|
float scale_;
|
2013-12-02 14:15:19 +00:00
|
|
|
float spacing_;
|
2013-07-20 18:48:21 +00:00
|
|
|
|
2013-07-20 10:54:33 +00:00
|
|
|
int dragPointerId_;
|
2013-07-20 10:06:06 +00:00
|
|
|
int down_;
|
|
|
|
};
|
|
|
|
|
2015-12-20 20:40:47 +00:00
|
|
|
class PSPStick : public GamepadView {
|
2013-07-20 10:06:06 +00:00
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
PSPStick(ImageID bgImg, const char *key, ImageID stickImg, ImageID stickDownImg, int stick, float scale, UI::LayoutParams *layoutParams);
|
2013-07-20 12:05:07 +00:00
|
|
|
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2015-02-02 23:11:51 +00:00
|
|
|
void Draw(UIContext &dc) override;
|
|
|
|
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override;
|
2013-07-20 10:06:06 +00:00
|
|
|
|
2019-11-13 17:55:18 +00:00
|
|
|
protected:
|
2013-07-20 12:05:07 +00:00
|
|
|
int dragPointerId_;
|
2020-02-29 20:51:14 +00:00
|
|
|
ImageID bgImg_;
|
|
|
|
ImageID stickImageIndex_;
|
|
|
|
ImageID stickDownImg_;
|
|
|
|
|
2013-07-20 10:06:06 +00:00
|
|
|
int stick_;
|
2013-07-20 12:05:07 +00:00
|
|
|
float stick_size_;
|
2013-07-20 10:06:06 +00:00
|
|
|
float scale_;
|
2015-03-05 09:58:25 +00:00
|
|
|
|
|
|
|
float centerX_;
|
|
|
|
float centerY_;
|
2019-11-13 17:55:18 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void ProcessTouch(float x, float y, bool down);
|
|
|
|
};
|
|
|
|
|
|
|
|
class PSPCustomStick : public PSPStick {
|
|
|
|
public:
|
2021-02-22 00:38:02 +00:00
|
|
|
PSPCustomStick(ImageID bgImg, const char *key, ImageID stickImg, ImageID stickDownImg, float scale, UI::LayoutParams *layoutParams);
|
2019-11-13 17:55:18 +00:00
|
|
|
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2019-11-13 17:55:18 +00:00
|
|
|
void Draw(UIContext &dc) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void ProcessTouch(float x, float y, bool down);
|
|
|
|
|
2020-03-05 17:29:35 +00:00
|
|
|
float posX_ = 0.0f;
|
|
|
|
float posY_ = 0.0f;
|
2013-07-20 10:06:06 +00:00
|
|
|
};
|
|
|
|
|
2013-10-09 20:15:56 +00:00
|
|
|
//initializes the layout from Config. if a default layout does not exist,
|
|
|
|
//it sets up default values
|
2014-02-10 14:55:21 +00:00
|
|
|
void InitPadLayout(float xres, float yres, float globalScale = 1.15f);
|
2021-08-28 18:06:05 +00:00
|
|
|
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPauseButton, ControlMapper* controllMapper);
|
2013-12-02 14:15:19 +00:00
|
|
|
|
|
|
|
const int D_pad_Radius = 50;
|
|
|
|
const int baseActionButtonSpacing = 60;
|
|
|
|
|
2023-05-08 08:13:16 +00:00
|
|
|
class CustomButton : public MultiTouchButton {
|
2015-06-28 05:34:05 +00:00
|
|
|
public:
|
2023-05-08 08:13:16 +00:00
|
|
|
CustomButton(uint64_t pspButtonBit, const char *key, bool toggle, bool repeat, ControlMapper* controllMapper, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, bool invertedContextDimension, UI::LayoutParams *layoutParams)
|
2022-11-23 11:22:59 +00:00
|
|
|
: MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit), toggle_(toggle), repeat_(repeat), controlMapper_(controllMapper), on_(false), invertedContextDimension_(invertedContextDimension) {
|
2015-06-28 05:34:05 +00:00
|
|
|
}
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2022-06-19 13:18:05 +00:00
|
|
|
void Update() override;
|
2021-03-04 09:37:35 +00:00
|
|
|
bool IsDown() override;
|
2021-08-04 07:18:23 +00:00
|
|
|
|
|
|
|
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override;
|
2015-06-28 05:34:05 +00:00
|
|
|
private:
|
2021-03-04 09:37:35 +00:00
|
|
|
uint64_t pspButtonBit_;
|
2020-02-12 14:48:49 +00:00
|
|
|
bool toggle_;
|
2022-06-19 13:18:05 +00:00
|
|
|
bool repeat_;
|
|
|
|
int pressedFrames_ = 0;
|
2022-11-23 11:22:59 +00:00
|
|
|
ControlMapper* controlMapper_;
|
2021-03-04 09:37:35 +00:00
|
|
|
bool on_;
|
2021-08-04 07:18:23 +00:00
|
|
|
bool invertedContextDimension_; // Swap width and height
|
2021-03-04 09:37:35 +00:00
|
|
|
};
|
|
|
|
|
2021-08-30 10:26:13 +00:00
|
|
|
class GestureGamepad : public UI::View {
|
|
|
|
public:
|
2022-11-23 11:22:59 +00:00
|
|
|
GestureGamepad(ControlMapper* controllMapper) : controlMapper_(controllMapper) {};
|
2021-08-30 10:26:13 +00:00
|
|
|
|
2022-11-27 15:15:16 +00:00
|
|
|
bool Touch(const TouchInput &input) override;
|
2021-08-30 10:26:13 +00:00
|
|
|
void Update() override;
|
2023-09-01 07:32:21 +00:00
|
|
|
void Draw(UIContext &dc) override;
|
2021-08-30 10:26:13 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
float lastX_ = 0.0f;
|
|
|
|
float lastY_ = 0.0f;
|
|
|
|
float deltaX_ = 0.0f;
|
|
|
|
float deltaY_ = 0.0f;
|
2023-09-01 07:32:21 +00:00
|
|
|
float downX_;
|
|
|
|
float downY_;
|
2021-08-30 10:26:13 +00:00
|
|
|
float lastTapRelease_ = 0.0f;
|
|
|
|
float lastTouchDown_ = 0.0f;
|
|
|
|
int dragPointerId_ = -1;
|
|
|
|
bool swipeLeftReleased_ = true;
|
|
|
|
bool swipeRightReleased_ = true;
|
|
|
|
bool swipeUpReleased_ = true;
|
|
|
|
bool swipeDownReleased_ = true;
|
|
|
|
bool haveDoubleTapped_ = false;
|
2022-11-23 11:22:59 +00:00
|
|
|
ControlMapper* controlMapper_;
|
2021-08-30 10:26:13 +00:00
|
|
|
};
|
|
|
|
|
2021-03-04 09:37:35 +00:00
|
|
|
// Just edit this to add new image, shape or button function
|
2023-03-26 08:48:59 +00:00
|
|
|
namespace CustomKeyData {
|
2021-03-04 09:37:35 +00:00
|
|
|
// Image list
|
|
|
|
struct keyImage {
|
|
|
|
ImageID i; // ImageID
|
|
|
|
float r; // Rotation angle in degree
|
|
|
|
};
|
2023-03-26 08:48:59 +00:00
|
|
|
static const keyImage customKeyImages[] = {
|
2021-09-22 21:14:35 +00:00
|
|
|
{ ImageID("I_1"), 0.0f },
|
|
|
|
{ ImageID("I_2"), 0.0f },
|
|
|
|
{ ImageID("I_3"), 0.0f },
|
|
|
|
{ ImageID("I_4"), 0.0f },
|
|
|
|
{ ImageID("I_5"), 0.0f },
|
|
|
|
{ ImageID("I_6"), 0.0f },
|
|
|
|
{ ImageID("I_A"), 0.0f },
|
|
|
|
{ ImageID("I_B"), 0.0f },
|
|
|
|
{ ImageID("I_C"), 0.0f },
|
|
|
|
{ ImageID("I_D"), 0.0f },
|
|
|
|
{ ImageID("I_E"), 0.0f },
|
|
|
|
{ ImageID("I_F"), 0.0f },
|
|
|
|
{ ImageID("I_CIRCLE"), 0.0f },
|
|
|
|
{ ImageID("I_CROSS"), 0.0f },
|
|
|
|
{ ImageID("I_SQUARE"), 0.0f },
|
|
|
|
{ ImageID("I_TRIANGLE"), 0.0f },
|
|
|
|
{ ImageID("I_L"), 0.0f },
|
|
|
|
{ ImageID("I_R"), 0.0f },
|
|
|
|
{ ImageID("I_START"), 0.0f },
|
|
|
|
{ ImageID("I_SELECT"), 0.0f },
|
|
|
|
{ ImageID("I_CROSS"), 45.0f },
|
|
|
|
{ ImageID("I_SQUARE"), 45.0f },
|
|
|
|
{ ImageID("I_TRIANGLE"), 180.0f },
|
|
|
|
{ ImageID("I_ARROW"), 90.0f},
|
|
|
|
{ ImageID("I_ARROW"), 270.0f},
|
|
|
|
{ ImageID("I_ARROW"), 0.0f},
|
|
|
|
{ ImageID("I_ARROW"), 180.0f},
|
|
|
|
{ ImageID("I_GEAR"), 0.0f},
|
2022-12-07 23:51:19 +00:00
|
|
|
{ ImageID("I_ROTATE_LEFT"), 0.0f},
|
|
|
|
{ ImageID("I_ROTATE_RIGHT"), 0.0f},
|
|
|
|
{ ImageID("I_ARROW_LEFT"), 0.0f},
|
|
|
|
{ ImageID("I_ARROW_RIGHT"), 0.0f},
|
|
|
|
{ ImageID("I_ARROW_UP"), 0.0f},
|
|
|
|
{ ImageID("I_ARROW_DOWN"), 0.0f},
|
|
|
|
{ ImageID("I_THREE_DOTS"), 0.0f},
|
2021-03-04 09:37:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Shape list
|
|
|
|
struct keyShape {
|
|
|
|
ImageID i; // ImageID
|
|
|
|
ImageID l; // ImageID line version
|
|
|
|
float r; // Rotation angle in dregree
|
|
|
|
bool f; // Flip Horizontally
|
2021-08-04 07:18:23 +00:00
|
|
|
bool d; // Invert height and width for context dimension (for example for 90 degree rot)
|
2021-03-04 09:37:35 +00:00
|
|
|
};
|
2023-03-26 08:48:59 +00:00
|
|
|
static const keyShape customKeyShapes[] = {
|
2021-09-22 21:14:35 +00:00
|
|
|
{ ImageID("I_ROUND"), ImageID("I_ROUND_LINE"), 0.0f, false, false },
|
|
|
|
{ ImageID("I_RECT"), ImageID("I_RECT_LINE"), 0.0f, false, false },
|
|
|
|
{ ImageID("I_RECT"), ImageID("I_RECT_LINE"), 90.0f, false, true },
|
|
|
|
{ ImageID("I_SHOULDER"), ImageID("I_SHOULDER_LINE"), 0.0f, false, false },
|
|
|
|
{ ImageID("I_SHOULDER"), ImageID("I_SHOULDER_LINE"), 0.0f, true, false },
|
|
|
|
{ ImageID("I_DIR"), ImageID("I_DIR_LINE"), 270.0f, false, true },
|
|
|
|
{ ImageID("I_DIR"), ImageID("I_DIR_LINE"), 90.0f, false, true },
|
|
|
|
{ ImageID("I_DIR"), ImageID("I_DIR_LINE"), 180.0f, false, false },
|
|
|
|
{ ImageID("I_DIR"), ImageID("I_DIR_LINE"), 0.0f, false, false },
|
|
|
|
{ ImageID("I_SQUARE_SHAPE"), ImageID("I_SQUARE_SHAPE_LINE"), 0.0f, false, false },
|
2023-10-20 13:28:31 +00:00
|
|
|
{ ImageID("I_EMPTY"), ImageID("I_EMPTY"), 0.0f, false, false },
|
2021-03-04 09:37:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Button list
|
|
|
|
struct keyList {
|
|
|
|
ImageID i; // UI ImageID
|
|
|
|
uint32_t c; // Key code
|
|
|
|
};
|
2023-03-26 08:48:59 +00:00
|
|
|
static const keyList customKeyList[] = {
|
2021-08-30 11:17:24 +00:00
|
|
|
{ ImageID("I_SQUARE"), CTRL_SQUARE },
|
|
|
|
{ ImageID("I_TRIANGLE"), CTRL_TRIANGLE },
|
|
|
|
{ ImageID("I_CIRCLE"), CTRL_CIRCLE },
|
|
|
|
{ ImageID("I_CROSS"), CTRL_CROSS },
|
|
|
|
{ ImageID::invalid(), CTRL_UP },
|
|
|
|
{ ImageID::invalid(), CTRL_DOWN },
|
|
|
|
{ ImageID::invalid(), CTRL_LEFT },
|
|
|
|
{ ImageID::invalid(), CTRL_RIGHT },
|
|
|
|
{ ImageID("I_START"), CTRL_START },
|
|
|
|
{ ImageID("I_SELECT"), CTRL_SELECT },
|
|
|
|
{ ImageID("I_L"), CTRL_LTRIGGER },
|
|
|
|
{ ImageID("I_R"), CTRL_RTRIGGER },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_RAPID_FIRE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_FASTFORWARD },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_SPEED_TOGGLE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_REWIND },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_SAVE_STATE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_LOAD_STATE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_NEXT_SLOT },
|
2021-09-01 15:07:35 +00:00
|
|
|
#if !defined(MOBILE_DEVICE)
|
2021-08-30 11:17:24 +00:00
|
|
|
{ ImageID::invalid(), VIRTKEY_TOGGLE_FULLSCREEN },
|
2021-09-01 15:07:35 +00:00
|
|
|
#endif
|
2021-08-30 11:17:24 +00:00
|
|
|
{ ImageID::invalid(), VIRTKEY_SPEED_CUSTOM1 },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_SPEED_CUSTOM2 },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_TEXTURE_DUMP },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_TEXTURE_REPLACE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_SCREENSHOT },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_MUTE_TOGGLE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_OPENCHAT },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_ANALOG_ROTATE_CW },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_ANALOG_ROTATE_CCW },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_PAUSE },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_DEVMENU },
|
2021-03-04 09:37:35 +00:00
|
|
|
#ifndef MOBILE_DEVICE
|
2021-08-30 11:17:24 +00:00
|
|
|
{ ImageID::invalid(), VIRTKEY_RECORD },
|
2021-03-04 09:37:35 +00:00
|
|
|
#endif
|
2023-01-28 06:42:20 +00:00
|
|
|
{ ImageID::invalid(), VIRTKEY_AXIS_X_MIN },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_AXIS_Y_MIN },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_AXIS_X_MAX },
|
|
|
|
{ ImageID::invalid(), VIRTKEY_AXIS_Y_MAX },
|
2023-05-26 13:47:58 +00:00
|
|
|
{ ImageID::invalid(), VIRTKEY_PREVIOUS_SLOT },
|
2021-03-04 09:37:35 +00:00
|
|
|
};
|
2023-03-26 08:48:59 +00:00
|
|
|
static_assert(ARRAY_SIZE(customKeyList) <= 64, "Too many key for a uint64_t bit mask");
|
2015-06-28 05:34:05 +00:00
|
|
|
};
|
2021-08-17 07:17:37 +00:00
|
|
|
|
2021-08-30 10:26:13 +00:00
|
|
|
// Gesture key only have virtual button that can work without constant press
|
|
|
|
namespace GestureKey {
|
2021-08-30 11:13:09 +00:00
|
|
|
static const uint32_t keyList[] = {
|
|
|
|
CTRL_SQUARE,
|
|
|
|
CTRL_TRIANGLE,
|
|
|
|
CTRL_CIRCLE,
|
|
|
|
CTRL_CROSS,
|
|
|
|
CTRL_UP,
|
|
|
|
CTRL_DOWN,
|
|
|
|
CTRL_LEFT,
|
|
|
|
CTRL_RIGHT,
|
|
|
|
CTRL_START,
|
|
|
|
CTRL_SELECT,
|
|
|
|
CTRL_LTRIGGER,
|
|
|
|
CTRL_RTRIGGER,
|
|
|
|
VIRTKEY_AXIS_Y_MAX,
|
|
|
|
VIRTKEY_AXIS_Y_MIN,
|
|
|
|
VIRTKEY_AXIS_X_MIN,
|
|
|
|
VIRTKEY_AXIS_X_MAX,
|
|
|
|
VIRTKEY_SPEED_TOGGLE,
|
|
|
|
VIRTKEY_REWIND,
|
|
|
|
VIRTKEY_SAVE_STATE,
|
|
|
|
VIRTKEY_LOAD_STATE,
|
2023-05-25 11:32:49 +00:00
|
|
|
VIRTKEY_PREVIOUS_SLOT,
|
2021-09-01 15:07:35 +00:00
|
|
|
VIRTKEY_NEXT_SLOT,
|
2021-08-30 11:13:09 +00:00
|
|
|
VIRTKEY_TEXTURE_DUMP,
|
|
|
|
VIRTKEY_TEXTURE_REPLACE,
|
|
|
|
VIRTKEY_SCREENSHOT,
|
|
|
|
VIRTKEY_MUTE_TOGGLE,
|
|
|
|
VIRTKEY_OPENCHAT,
|
|
|
|
VIRTKEY_PAUSE,
|
|
|
|
VIRTKEY_DEVMENU,
|
2021-08-30 10:26:13 +00:00
|
|
|
#ifndef MOBILE_DEVICE
|
2021-08-30 11:13:09 +00:00
|
|
|
VIRTKEY_RECORD,
|
2021-08-30 10:26:13 +00:00
|
|
|
#endif
|
2023-01-28 06:42:20 +00:00
|
|
|
VIRTKEY_AXIS_X_MIN,
|
|
|
|
VIRTKEY_AXIS_Y_MIN,
|
|
|
|
VIRTKEY_AXIS_X_MAX,
|
|
|
|
VIRTKEY_AXIS_Y_MAX,
|
2021-08-30 10:26:13 +00:00
|
|
|
};
|
|
|
|
}
|
2023-12-29 16:07:49 +00:00
|
|
|
|
2023-12-29 16:37:34 +00:00
|
|
|
void GamepadTouch(bool reset = false);
|
2023-12-29 16:24:15 +00:00
|
|
|
void GamepadUpdateOpacity(float force = -1.0f);
|
|
|
|
float GamepadGetOpacity();
|