Software Keyboard: Difference between revisions
(13 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
The below is for normal swkbd usage, see the [[#InlineKeyboard]] section for InlineKeyboard. | The below is for normal swkbd usage, see the [[#InlineKeyboard]] section for InlineKeyboard. | ||
With version 0x6000B+ after pushing all other storage: when [[#CustomizedDictionarySet]] was setup where buffer addr/size is set and total_entries is non-zero, [[Applet_Manager_services#CreateHandleStorage]] will be used to create TransferMemory storage which is then pushed. | |||
== Library Applet Versions == | == Library Applet Versions == | ||
Line 23: | Line 25: | ||
|- | |- | ||
| [5.0.0+] || 0x50009 | | [5.0.0+] || 0x50009 | ||
|- | |||
| [6.0.0+] || 0x6000B | |||
|- | |||
| [8.0.0+] || 0x8000D | |||
|} | |} | ||
Line 74: | Line 80: | ||
|- | |- | ||
| 0x3D0 || 1 || 0 || [[#Text check]] enable | | 0x3D0 || 1 || 0 || [[#Text check]] enable | ||
|} | |||
Before version 0x6000B: | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Offset || Size || Typical Value || Notes | ||
|- | |- | ||
| 0x3E0 || 0x20 || -1 || When set and enabled via textDrawType, controls displayed text grouping (inserts spaces, without affecting output string). Used for DownloadCodes. | | 0x3D8 || 8 || 0 || [[#Text check]] callback function address. Removed with the struct used by 0x6000B+. | ||
|- | |||
| 0x3E0 || 0x20 || -1 || When set and enabled via textDrawType, controls displayed text grouping (inserts spaces, without affecting output string). Used for DownloadCodes, otherwise this is -1 normally. | |||
|} | |} | ||
Version 0x6000B+: | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Typical Value || Notes | |||
|- | |||
| 0x3D4 || 0x20 || -1 || When set and enabled via textDrawType, controls displayed text grouping (inserts spaces, without affecting output string). Used for DownloadCodes, otherwise this is -1 normally. | |||
|- | |||
| 0x3F4 || 0xC0 || 0 || [[#CustomizedDictionarySet]] array data. | |||
|- | |||
| 0x4B4 || 0x1 || 0 || Total array entries for [[#CustomizedDictionarySet]]. | |||
|- | |||
| 0x4B5 || 0x1 || 0 || [8.0.0+] Cancel Button Flag (0 = do not disable cancel, 1 = disable cancel) | |||
|- | |||
| 0x4B6 || 0xD || 0 || Padding | |||
|- | |||
| 0x4C3 || 0x1 || 0 || [8.0.0+] Trigger | |||
|- | |||
| 0x4C4 || 0x4 || 0 || Padding | |||
|} | |||
Struct sizes: | |||
* Initial version: 0x3E0-bytes. | |||
* Version 0x30007+: 0x400-bytes. | |||
* Version 0x6000B+: 0x4C8-bytes. | |||
Each entry in the user dictionary is 100 bytes long. | Each entry in the user dictionary is 100 bytes long. | ||
Line 231: | Line 264: | ||
The above struct is cleared to 0 during initialization, besides the fields specified otherwise. | The above struct is cleared to 0 during initialization, besides the fields specified otherwise. | ||
[6.0.0+] Flags bitmask 0x10000 is set when [[#CalcArg]] trigger is set. | |||
=== CalcArg === | === CalcArg === | ||
Line 303: | Line 338: | ||
| 0x49C || 0x1 || Enable=0x2000, disable=0x4000. || [5.0.0+] SeGroup (sound effect) | | 0x49C || 0x1 || Enable=0x2000, disable=0x4000. || [5.0.0+] SeGroup (sound effect) | ||
|- | |- | ||
| 0x49D || | | 0x49D || 0x1 || || [6.0.0+] u8 triggerFlag, for [[#AppearArg]]. Enables using the trigger field when set, this is only set when trigger is non-zero. | ||
|- | |||
| 0x49E || 0x2 || || [6.0.0+] u8 trigger, for [[#AppearArg]]. Official sw currently only uses value 0. | |||
|- | |||
| 0x49F || 0x1 || || Padding | |||
|- | |- | ||
|} | |} | ||
Line 327: | Line 366: | ||
|- | |- | ||
| 0x4 || 0x0 || Finalize || | | 0x4 || 0x0 || Finalize || | ||
|- | |||
| 0x6 || Varies || SetUserWordInfo || | |||
|- | |- | ||
| 0x7 || 0x70 || SetCustomizeDic || | | 0x7 || 0x70 || SetCustomizeDic || | ||
|- | |- | ||
| 0xA || 0x4A0 || Calc || Data is [[#CalcArg]]. | | 0xA || 0x4A0 || Calc || Data is [[#CalcArg]]. | ||
|- | |||
| 0xB || 0xD0 || SetCustomizedDictionaries || Data is [[#CustomizedDictionarySet]] with an additional 2-bytes of padding. | |||
|- | |||
| 0xC || 0x0 || UnsetCustomizedDictionaries || | |||
|- | |||
| 0xD || 0x1 || [8.0.0+] || Takes an input u8 bool which controls whether ChangedString*V2 or ChangedString* replies should be used. | |||
|- | |||
| 0xE || 0x1 || [8.0.0+] || Takes an input u8 bool which controls whether MovedCursor*V2 or MovedCursor* replies should be used. | |||
|} | |} | ||
Line 363: | Line 412: | ||
|- | |- | ||
| 0xB || 0x0 || ReleasedUserWordInfo || | | 0xB || 0x0 || ReleasedUserWordInfo || | ||
|- | |||
| 0xC || 0x0 || UnsetCustomizedDictionaries || [6.0.0+] Official sw handles this the same as UnsetCustomizeDic. | |||
|- | |||
| 0xD || 0x3FC + 0x1 || ChangedStringV2 || [8.0.0+] | |||
|- | |||
| 0xE || 0x3F4 + 0x1 || MovedCursorV2 || [8.0.0+] | |||
|- | |||
| 0xF || 0x7E4 + 0x1 || ChangedStringUtf8V2 || [8.0.0+] | |||
|- | |||
| 0x10 || 0x7DC + 0x1 || MovedCursorUtf8V2 || [8.0.0+] | |||
|- | |- | ||
|} | |} | ||
Line 371: | Line 430: | ||
Reply data format: | Reply data format: | ||
* ChangedString*: +0 = string. Last 0x10-bytes: 4 u32s, where the first one is the length of the string in characters, | * ChangedString*: +0 = string. Last 0x10-bytes: 4 u32s, where the first one is the length of the string in characters, without NUL-terminator. The last u32 is cursorPos. The other 2 fields are s32s. | ||
* MovedCursor*: +0 = string. Last 0x8-bytes: 2 u32s, where the first one is the stringLen, and the second one is cursorPos. | |||
* DecidedEnter*: +0 = string. The last u32 is the stringLen. | |||
* *V2: See above. Last byte: u8 bool, passed to the callback as <code>flag==0</code>. | |||
== CustomizedDictionarySet == | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || 0x1000-byte aligned buffer address. | |||
|- | |||
| 0x8 || 0x4 || 0x1000-byte aligned buffer size. | |||
|- | |||
| 0xC || 0x18*4(0xC0) || Array of 0x18 entries, where each entry is 0x8-bytes. | |||
|- | |||
| 0xCC || 0x2 || u16 total_entries | |||
|} | |||
This was added with [6.0.0+]. This struct is 0xCE-bytes. | |||
[[Category:Library Applets]] | [[Category:Library Applets]] |