ManaPlus
Macros | Functions
touchactions.h File Reference

(986a3bf)

#include "localconsts.h"

Go to the source code of this file.

Macros

#define decHandler(name)   void name(const MouseInput &mouseInput)
 

Functions

void padClick (const MouseInput &mouseInput)
 
void padEvents (const MouseInput &mouseInput)
 
void padOut (const MouseInput &mouseInput)
 
void padUp (const MouseInput &mouseInput)
 
void setHalfJoyPad (const int s)
 

Macro Definition Documentation

◆ decHandler

#define decHandler (   name)    void name(const MouseInput &mouseInput)

Definition at line 27 of file touchactions.h.

Function Documentation

◆ padClick()

void padClick ( const MouseInput mouseInput)

Definition at line 105 of file touchactions.cpp.

106 {
107  moveChar(mouseInput.getX(), mouseInput.getY());
108  padClicked = true;
109 }
int getX() const
Definition: mouseinput.h:149
int getY() const
Definition: mouseinput.h:159
static void moveChar(int x, int y)
bool padClicked(false)

References moveChar(), and padClicked().

Referenced by TouchManager::loadPad().

◆ padEvents()

void padEvents ( const MouseInput mouseInput)

Definition at line 111 of file touchactions.cpp.

112 {
113  if (mouseInput.getType() == MouseEventType::MOVED)
114  {
115  if (padClicked)
116  moveChar(mouseInput.getX(), mouseInput.getY());
117  }
118 }
MouseEventTypeT getType() const
Definition: mouseinput.h:119

References moveChar(), MouseEventType::MOVED, and padClicked().

Referenced by TouchManager::loadPad().

◆ padOut()

void padOut ( const MouseInput mouseInput)

Definition at line 120 of file touchactions.cpp.

121 {
122  padClicked = false;
124 }
int halfJoyPad

References halfJoyPad, moveChar(), and padClicked().

Referenced by TouchManager::loadPad().

◆ padUp()

void padUp ( const MouseInput mouseInput)

Definition at line 126 of file touchactions.cpp.

127 {
128  padClicked = false;
130 }

References halfJoyPad, moveChar(), and padClicked().

Referenced by TouchManager::loadPad().

◆ setHalfJoyPad()

void setHalfJoyPad ( const int  s)

Definition at line 37 of file touchactions.cpp.

38 {
39  halfJoyPad = s;
40 }

References halfJoyPad.

Referenced by TouchManager::init(), and TouchManager::optionChanged().