tcMenu
Public Member Functions | List of all members
tcgfx::MenuTouchScreenManager Class Reference

#include <MenuTouchScreenEncoder.h>

Inheritance diagram for tcgfx::MenuTouchScreenManager:

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MenuTouchScreenManager()

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.

Parameters
devicethe analog device that will read analog inputs. - always must be internal analog pins
pinsthe pins that will be used for digital IO - always must be internal device pins
xpPinthe X+ pin from the touch unit
xnPinthe X- pin from the touch unit - requires analog input pin
ypPinthe Y+ pin from the touch unit - requires analog input pin
ynPinthe Y- pin from the touch unit
rendererthe graphics renderer that is in use
rotationthe rotation of the touch interface

Member Function Documentation

◆ setSecondaryObserver()

void tcgfx::MenuTouchScreenManager::setSecondaryObserver ( TouchObserver secondaryObs)
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.

Parameters
secondaryObsthe secondary listener

◆ clearSecondaryObserver()

void tcgfx::MenuTouchScreenManager::clearSecondaryObserver ( )
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.


The documentation for this class was generated from the following files: