As you may (or may not) know, we can't yet access the original Nintendo keyboard from homebrew. After many hours of researching, I found out, that launching the keyboard is very overcomplicated, and builtin ctrulib functions aren't enough to get the keyboard working (but it's possible to use ctrulib, if you add the line "extern Handle aptuHandle;" to the file include/3ds/services/apt.h).
So, let me share what I have researched so far:
So, let me share what I have researched so far:
- config structure
- The structure size must be 0x400 (if not, then a "failsafe" keyboard is opened, see below)
- If the structure is "invalid", the system freezes (probably a nullptr)
- You'll need to use a special "SetInputData" function to properly initialize some variables, otherwise the structure is treated as invalid (which can be reprogrammed in homebrew, because it's just pure struct-access)
- The text uses wchar_t, but in devkitPro it's 4bytes big (according to this), so we need to use u16 + the unicode lib in ctrulib instead of wchar_t
- The keyboard requires a shared memory, or a kernel object we don't have access to (but it may be possible to reprogram it), or else the system will freeze (also, calculating the required shared memory is tedious, but can be done)
- launching
- The keyboard is launched in a very specific way, and this makes it very hard to operate, because we need to re-implement most of the C++ stuff in plain ol' C in a homebrew environment
- misc
- We can't have a spellchecker callback function, because we don't know where the original keyboard C++ object is stored. Also, it requires access to a function that sets 2 C++ variables, but because we don't know its address, we can't call it, so that's a double nope
- the "failsafe" keyboard
- If we are lucky, and the system doesn't crash, we get a failsafe keyboard, which is just a plain parental control PIN input
- Triggering the failsafe keyboard the second time either breaks the keyboard until next reboot (which could be probably fixed by forcing an applet unload), or softlocks the system, in both cases forcing a reboot.
Last edited by Sono,