Homebrew [swkbd] Software keyboard research thread

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,654
Trophies
2
Location
rehabilitation center
XP
8,220
Country
Hungary
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:
  • 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,

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,673
Trophies
2
XP
8,100
Country
Tuvalu
we still can't do it? annoying... :)
i think someone made a homebrew keyboard, right? is that the only solution, apart from every dev making their own?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,654
Trophies
2
Location
rehabilitation center
XP
8,220
Country
Hungary
we still can't do it? annoying... :)
i think someone made a homebrew keyboard, right? is that the only solution, apart from every dev making their own?

I just don't have time to continue research :(
Btw, with much work it's possible to use the keyboard, but it requires a very precise setup, and some functions access C++ variables somewhere I can't access it :/
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,673
Trophies
2
XP
8,100
Country
Tuvalu

Red9419

Well-Known Member
Member
Joined
Apr 17, 2014
Messages
526
Trophies
0
XP
785
Country
Isn't it possible to launch the keyboard using a leaked sdk? Distributing homebrew with that would be illegal so i guess it would be pointless.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,654
Trophies
2
Location
rehabilitation center
XP
8,220
Country
Hungary
yeah don't worry, i guess this is good :) this seems nice in the mean time
http://gbatemp.net/threads/hbkblib-a-3ds-keyboard-library.397568/

Ye, I know that :P But the original keyboard uses wide characters, so it should be possible to enter japanese characters.

--------------------- MERGED ---------------------------

Isn't it possible to launch the keyboard using a leaked sdk? Distributing homebrew with that would be illegal so i guess it would be pointless.

Let's say, it's not compatible with ctrulib, and requires a painful setup to compile. Also, appearently using those statically linked libraries is illegal...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Skelletonike @ Skelletonike:
    There are different ways of fanservice
  • Skelletonike @ Skelletonike:
    the first manga I bought, was Psychic Academy, when I was like 12?
  • Skelletonike @ Skelletonike:
    That was good 2000s ecchi
  • Skelletonike @ Skelletonike:
    Great plot too
  • Vetusomaru @ Vetusomaru:
    psychic academy. lol. it was meh even back then when i bought volume 1. also same author also made one of the manga adaptions of Escaflowne.
  • Skelletonike @ Skelletonike:
    Pfffft!
  • Skelletonike @ Skelletonike:
    I have all the volumes.
  • Vetusomaru @ Vetusomaru:
    btw do u have discord?
  • Vetusomaru @ Vetusomaru:
    last tv anime i remember with nipples i personally watched was Senran Kagura
  • Skelletonike @ Skelletonike:
    yeah I do
  • Skelletonike @ Skelletonike:
    I mostly read, haven't watched much, but I do keep my cunchyroll sub.
  • Skelletonike @ Skelletonike:
    Found out one of my fave animes got an adaptation this season

    the other day lol
  • Skelletonike @ Skelletonike:
    Yuusha ga Shi
    nda
  • Vetusomaru @ Vetusomaru:
    crynchyrolls is cancer, especially with the censorship they do like they did with Oshimai
  • Vetusomaru @ Vetusomaru:
    can u post your discord here or at dm?
  • Skelletonike @ Skelletonike:
    No idea
  • Skelletonike @ Skelletonike:
    it's my username
  • Vetusomaru @ Vetusomaru:
    and number?
  • Skelletonike @ Skelletonike:
    it needs the number?
  • Vetusomaru @ Vetusomaru:
    okey dokey. i ve sent u friend request.
  • Vetusomaru @ Vetusomaru:
    i have same username with here
  • Skelletonike @ Skelletonike:
    alright, accepted
    +1
    Skelletonike @ Skelletonike: alright, accepted +1