Hal refactored (#99)
This commit is contained in:
committed by
GitHub
parent
0188ce721c
commit
33bb742dfb
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "hal/Keyboard.h"
|
||||
|
||||
#include <TactilityCore.h>
|
||||
|
||||
class SdlKeyboard : public tt::hal::Keyboard {
|
||||
private:
|
||||
lv_indev_t* _Nullable handle = nullptr;
|
||||
|
||||
public:
|
||||
bool start(lv_display_t* display) override {
|
||||
handle = lv_sdl_keyboard_create();
|
||||
return handle != nullptr;
|
||||
}
|
||||
|
||||
bool stop() override { tt_crash("Not supported"); }
|
||||
|
||||
bool isAttached() const override { return true; }
|
||||
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return handle; }
|
||||
};
|
||||
|
||||
tt::hal::Keyboard* createKeyboard() {
|
||||
return static_cast<tt::hal::Keyboard*>(new SdlKeyboard());
|
||||
}
|
||||
Reference in New Issue
Block a user