Guest User

bad touch

a guest
Dec 5th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1.  
  2. template <class T, class U> class Pair{
  3. public:
  4.     T a;
  5.     U b;
  6.    
  7.     Pair(){
  8.         a = T();
  9.         b = U();
  10.     };
  11.    
  12.     Pair(T aa, U bb){
  13.         a = aa;
  14.         b = bb;
  15.     };
  16. };
  17.  
  18. class touch{
  19. public:
  20.     uint16_t x;
  21.     uint16_t y;
  22.    
  23.     touch(){};
  24.  
  25.     void ReadCoordinates(void);
  26.  
  27.     Pair<uint16_t, uint16_t> ReadKey(void);
  28.    
  29.     void wait_release_key(void);
  30. };
  31.  
  32.  
  33. Pair<uint16_t, uint16_t> touch::ReadKey(void)
  34. {
  35.     Touch.ReadCoordinates();
  36.     wait_release_key();
  37.     return Pair<uint16_t, uint16_t>(this->x, this->y);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment