summaryrefslogtreecommitdiff
path: root/src/touchmanager.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-31 18:57:56 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-31 18:57:56 +0300
commit6fbb71142de5b2b12c2153b41a21b6dc34284343 (patch)
tree408d3671ac75bd349f86e13ae614bf838672fffe /src/touchmanager.h
parent021fa9fe787fe4dd1a6d97b77e94400fac179f23 (diff)
downloadplus-6fbb71142de5b2b12c2153b41a21b6dc34284343.tar.gz
plus-6fbb71142de5b2b12c2153b41a21b6dc34284343.tar.bz2
plus-6fbb71142de5b2b12c2153b41a21b6dc34284343.tar.xz
plus-6fbb71142de5b2b12c2153b41a21b6dc34284343.zip
Add configurable actions for onscreen buttons.
Diffstat (limited to 'src/touchmanager.h')
-rw-r--r--src/touchmanager.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/touchmanager.h b/src/touchmanager.h
index 512c82909..ea8a3a72f 100644
--- a/src/touchmanager.h
+++ b/src/touchmanager.h
@@ -46,12 +46,17 @@ const int actionsSize = Input::KEY_TOTAL;
struct TouchItem final
{
- TouchItem(const gcn::Rectangle rect0, int type0, ImageRect *const images0,
- Image *const icon0, int x0, int y0, int width0, int height0,
+ TouchItem(const gcn::Rectangle rect0, int type0,
+ const std::string &eventPressed0,
+ const std::string &eventReleased0,
+ ImageRect *const images0, Image *const icon0,
+ int x0, int y0, int width0, int height0,
TouchFuncPtr ptrAll, TouchFuncPtr ptrPressed,
TouchFuncPtr ptrReleased, TouchFuncPtr ptrOut) :
rect(rect0),
type(type0),
+ eventPressed(eventPressed0),
+ eventReleased(eventReleased0),
images(images0),
icon(icon0),
x(x0),
@@ -69,6 +74,8 @@ struct TouchItem final
gcn::Rectangle rect;
int type;
+ std::string eventPressed;
+ std::string eventReleased;
ImageRect *images;
Image *icon;
int x;
@@ -105,9 +112,13 @@ class TouchManager final : public ConfigListener
void loadTouchItem(TouchItem **item, std::string name,
std::string imageName,
- int type, int x, int y, int width, int height,
- TouchFuncPtr fAll, TouchFuncPtr fPressed,
- TouchFuncPtr fReleased, TouchFuncPtr fOut);
+ int x, int y, int width, int height,
+ int type, const std::string &eventPressed,
+ const std::string &eventReleased,
+ TouchFuncPtr fAll = nullptr,
+ TouchFuncPtr fPressed = nullptr,
+ TouchFuncPtr fReleased = nullptr,
+ TouchFuncPtr fOut = nullptr);
void clear();
@@ -146,6 +157,8 @@ class TouchManager final : public ConfigListener
void shutdown();
+ void executeAction(const std::string &event);
+
private:
TouchItem *mKeyboard;
TouchItem *mPad;