/ src / input / input_keypad.h
input_keypad.h
 1  #pragma once
 2  
 3  #include <cstdint>
 4  
 5  #include "lvgl.h"
 6  #include "input_hal.h"
 7  
 8  namespace input
 9  {
10  	class Keypad
11  	{
12  	public:
13  		Keypad();
14  		virtual ~Keypad();
15  		Keypad(const Keypad &) = delete;
16  		Keypad &operator=(const Keypad &) = delete;
17  
18  		lv_group_t* GetInputGroup();
19  	private:
20  		void CreateDevice();
21  		lv_indev_t* keypadDev = nullptr;
22  		lv_group_t* inputGroup = nullptr;
23  		lv_key_t lastKeyPressed = LV_KEY_NONE;
24  
25  		static bool ReadCallback(lv_indev_drv_t* driver, lv_indev_data_t*data);
26  	};
27  } // namespace input