#include <MenuTouchScreenEncoder.h>
Public Member Functions | |
MenuTouchScreenManager (iotouch::TouchInterrogator *interrogator, BaseGraphicalRenderer *renderer, const iotouch::TouchOrientationSettings &rotation) | |
void | sendEvent (float locationX, float locationY, float touchPressure, iotouch::TouchState touched) override |
iotouch::TouchState | getLastTouchState () const |
float | getLastX () const |
float | getLastY () const |
Coord | getLastScreenCoord () |
void | setSecondaryObserver (TouchObserver *secondaryObs) |
void | clearSecondaryObserver () |
void | sendToObservers (TouchNotification notification) |
This class provides support for resistive touch screens within tcMenu, it is the layer between the IoAbstraction touch interface class and tcMenu's rendering system, it uses the renderer to work out if the touch was within a menu item and prepares the touch events. Normally this class is instantiated in your project by tcMenu Designer if you choose a touch interface.
tcgfx::MenuTouchScreenManager::MenuTouchScreenManager | ( | iotouch::TouchInterrogator * | interrogator, |
BaseGraphicalRenderer * | renderer, | ||
const iotouch::TouchOrientationSettings & | rotation | ||
) |
Create a touch screen interface for a resistive touch screen, this does not start the interface, you need to call start() yourself to do that.
device | the analog device that will read analog inputs. - always must be internal analog pins |
pins | the pins that will be used for digital IO - always must be internal device pins |
xpPin | the X+ pin from the touch unit |
xnPin | the X- pin from the touch unit - requires analog input pin |
ypPin | the Y+ pin from the touch unit - requires analog input pin |
ynPin | the Y- pin from the touch unit |
renderer | the graphics renderer that is in use |
rotation | the rotation of the touch interface |
|
inline |
You can register a second temporary observer to receive touch updates, the card layout does this, and any other takeOverDisplay or other situation that needs such a temporary notification of touch can do so.
secondaryObs | the secondary listener |
|
inline |
Clear the secondary lister added by setSecondaryLister, note that if you are going to deallocate an object that is a listener you must call this first.