From 6df9b94c438c386076712b4b46159259af39759a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 1 Oct 2026 19:57:48 -0500 Subject: [PATCH] Generate hardware keyboard vtable from C++ declarations --- include/keyboard/tiHwKeyboard.h | 4 ++-- src/keyboard/tiHwKeyboard.cpp | 23 +---------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/include/keyboard/tiHwKeyboard.h b/include/keyboard/tiHwKeyboard.h index cc202585..2e0029b8 100644 --- a/include/keyboard/tiHwKeyboard.h +++ b/include/keyboard/tiHwKeyboard.h @@ -15,7 +15,7 @@ namespace textinput { #endif public: HWKeyboard(Manager *); -#ifdef TIMANAGER_IMPLEMENTATION +#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) inline ~HWKeyboard(); #else ~HWKeyboard(); @@ -29,7 +29,7 @@ namespace textinput { wchar_t convertWCCode(wchar_t code) const; #endif -#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) +#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); #else virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); diff --git a/src/keyboard/tiHwKeyboard.cpp b/src/keyboard/tiHwKeyboard.cpp index 4daeb1a6..33febab8 100644 --- a/src/keyboard/tiHwKeyboard.cpp +++ b/src/keyboard/tiHwKeyboard.cpp @@ -5,15 +5,7 @@ #include "keyboard/tiHKBManager.h" #include "keyboard/tiLayoutGather.h" -extern "C" bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager(); -extern "C" void __dt__Q49textinput8keyboard5hwkey10HWKeyboardFv(); -extern "C" void create__Q29textinput4BaseFP12MEMAllocator(); -extern "C" void init__Q49textinput8keyboard5hwkey10HWKeyboardFv(); -extern "C" void setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver(); -extern "C" void sendCommand__Q29textinput13CommandSenderFUlPv(); -extern "C" void updateFromReceiver__Q29textinput13CommandSenderFUlPv(); -typedef void (*KeyboardDataFunction)(); namespace textinput { @@ -481,20 +473,7 @@ const u8 controlKeys[] = { return code; } -#pragma push -#pragma section const_type ".data" -extern "C" KeyboardDataFunction const __vt__Q49textinput8keyboard5hwkey10HWKeyboard[9] = { - NULL, - NULL, - __dt__Q49textinput8keyboard5hwkey10HWKeyboardFv, - create__Q29textinput4BaseFP12MEMAllocator, - init__Q49textinput8keyboard5hwkey10HWKeyboardFv, - setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver, - sendCommand__Q29textinput13CommandSenderFUlPv, - updateFromReceiver__Q29textinput13CommandSenderFUlPv, - reinterpret_cast(updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager) -}; -#pragma pop + void HWKeyboard::setLanguage(Destination destination, Language language) { if (destination == DST_EU) { -- 2.49.1