@@ -612,6 +612,212 @@ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
612612
613613#endif
614614
615+ /* Platform specific functions for Wii U */
616+ #if defined(__WIIU__ )
617+ typedef enum SDL_WiiUSysWMEventType {
618+ /** Sent before any text input event. */
619+ SDL_WIIU_SYSWM_SWKBD_OK_START_EVENT = 1 ,
620+ /** Sent after all text input events. */
621+ SDL_WIIU_SYSWM_SWKBD_OK_FINISH_EVENT ,
622+ /** Sent after the swkbd was canceled. */
623+ SDL_WIIU_SYSWM_SWKBD_CANCEL_EVENT
624+ } SDL_WiiUSysWMEventType ;
625+
626+ /**
627+ * Disable the swkbd.
628+ *
629+ * Use this function if you only want text input from a physical USB keyboard.
630+ *
631+ * \param enabled `SDL_FALSE` if you do not want the swkbd to show up after calling
632+ * `SDL_StartTextInput()`.
633+ */
634+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDEnabled (SDL_bool enabled );
635+
636+ /**
637+ * Select the swkbd keyboard mode.
638+ *
639+ * \sa SDL_WiiUSetSWKBDKeyboardMode
640+ */
641+ typedef enum SDL_WiiUSWKBDKeyboardMode {
642+ /** Full keyboard. */
643+ SDL_WIIU_SWKBD_KEYBOARD_MODE_FULL ,
644+ /** Numeric keyboard. */
645+ SDL_WIIU_SWKBD_KEYBOARD_MODE_NUMPAD ,
646+ /** Restricted keyboard (only letters, numbers and symbols.) */
647+ SDL_WIIU_SWKBD_KEYBOARD_MODE_RESTRICTED ,
648+ /** NNID keyboard. */
649+ SDL_WIIU_SWKBD_KEYBOARD_MODE_NNID
650+ } SDL_WiiUSWKBDKeyboardMode ;
651+
652+ /**
653+ * Sets the swkbd's keyboard mode.
654+ *
655+ * \param mode One of SDL_WiiUSWKBDKeyboardMode. The default is
656+ * `SDL_WIIU_SWKBD_KEYBOARD_MODE_FULL`.
657+ *
658+ * \note
659+ * This option is reset to the default value after the swkbd is shown.
660+ */
661+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDKeyboardMode (SDL_WiiUSWKBDKeyboardMode mode );
662+
663+ /**
664+ * Sets the label for the swkbd's "OK" button.
665+ *
666+ * \param label String for the "OK" button, encoded in UTF-8, or `NULL` to use the
667+ * default.
668+ *
669+ * \note
670+ * This option is reset to the default value after the swkbd is shown.
671+ */
672+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDOKLabel (const char * label );
673+
674+ /**
675+ * Sets the swkbd's word suggestions option.
676+ *
677+ * \param show `SDL_TRUE` to enable word suggestions. The default is `SDL_TRUE`.
678+ *
679+ * \note
680+ * This option is reset to the default value after the swkbd is shown.
681+ */
682+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDShowWordSuggestions (SDL_bool show );
683+
684+ /**
685+ * Sets the swkbd's initial text.
686+ *
687+ * \param text String for the initial text, encoded in UTF-8, or `NULL` to use the
688+ * default (no initial text.)
689+ *
690+ * \note
691+ * This option is reset to the default value after the swkbd is shown.
692+ */
693+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDInitialText (const char * text );
694+
695+ /**
696+ * Sets the swkbd's hint text.
697+ *
698+ * \param text String for the hint text, encoded in UTF-8, or `NULL` to use the default
699+ * (no hint.)
700+ *
701+ * \note
702+ * This option is reset to the default value after the swkbd is shown.
703+ */
704+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDHintText (const char * text );
705+
706+ /**
707+ * Controls how to display passwwords in the swkbd when in password mode.
708+ */
709+ typedef enum SDL_WiiUSWKBDPasswordMode {
710+ SDL_WIIU_SWKBD_PASSWORD_MODE_SHOW , /**< Show password. */
711+ SDL_WIIU_SWKBD_PASSWORD_MODE_HIDE , /**< Hide password. */
712+ SDL_WIIU_SWKBD_PASSWORD_MODE_FADE /**< Hide password after 1 second. */
713+ } SDL_WiiUSWKBDPasswordMode ;
714+
715+ /**
716+ * Sets the swkbd's password mode.
717+ *
718+ * \param mode One of of the SDL_WiiUSWKBDPasswordMode values. The default is
719+ * `SDL_WIIU_SWKBD_PASSWORD_MODE_SHOW`.
720+ *
721+ * \note
722+ * This option is reset to the default value after the swkbd is shown.
723+ *
724+ * \sa SDL_WiiUSetSWKBDKeyboardMode
725+ */
726+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDPasswordMode (SDL_WiiUSWKBDPasswordMode mode );
727+
728+ /**
729+ * Sets whether to highlight (select) the swkbd's initial text.
730+ *
731+ * \param highlight `SDL_TRUE` to highlight the initial text. The default is `SDL_FALSE`.
732+
733+ * \note
734+ * This option is reset to the default value after the swkbd is shown.
735+ */
736+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDHighlightInitialText (SDL_bool highlight );
737+
738+ /**
739+ * Sets the swkbd's copy-paste button option.
740+ *
741+ * \param show `SDL_TRUE` to show copy-paste buttons. The default is `SDL_FALSE`.
742+ *
743+ * \note
744+ * This option is reset to the default value after the swkbd is shown.
745+ */
746+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDShowCopyPasteButtons (SDL_bool show );
747+
748+ /**
749+ * Sets the swkbd's built-in rendering of the Wii remote pointer.
750+ *
751+ * \param draw `SDL_TRUE` to let the swkbd draw its own Wii remote pointer. The default is
752+ * `SDL_TRUE`.
753+ *
754+ * This option is reset to the default value after the swkbd is shown.
755+ */
756+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDDrawWiiPointer (SDL_bool draw );
757+
758+ /**
759+ * Sets the swkbd's locale (region and language.)
760+ *
761+ * \param locale String representing the intended keyboard region and language, using
762+ * Unix-style locale format (e.g. `"en_US"`, `"fr_CA"`, `ja_JP`, `"en"`.) Set to `NULL` to
763+ * use the system region and language. The default is `NULL`.
764+ *
765+ * The recognized languages are:
766+ * - ja: Japanese
767+ * - en: English
768+ * - fr: French
769+ * - de: German
770+ * - it: Italian
771+ * - es: Spanish
772+ * - nl: Dutch
773+ * - pt: Portuguese
774+ * - ru: Russian
775+ *
776+ * The recognized regions are:
777+ * - US, CA, MX, BR: mapped to the "USA" console region.
778+ * - DE, ES, FR, GB, IT, NL, PT, RU: mapped to the "EUR" console region.
779+ * - JP: mapped to the "JPN" console region.
780+ *
781+ * When no country is specified, "jp" will map to the "JPN" region, "en" to "USA" region,
782+ * and everything else will map to "EUR" region.
783+ *
784+ * By default the locale is obtained from the system configuration (cafe.language). The
785+ * empty locale string is equivalent to the system configuration.
786+ *
787+ * \note
788+ * The swkbd will be re-initialized after calling this function.
789+ */
790+ extern DECLSPEC void SDLCALL SDL_WiiUSetSWKBDLocale (const char * locale );
791+
792+ /**
793+ * Sends VPAD input to the swkbd.
794+ *
795+ * Call this function at every frame if your application calls `VPADRead()` instead of
796+ * using the SDL game controller subsystem.
797+ *
798+ * \param vpad Pointer to a `VPADStatus` object.
799+ * \returns `SDL_TRUE` if the swkbd is visible and is going to use the input.
800+ *
801+ * \note
802+ * The touch point in `tpNormal` should contain a calibrated point, by calling
803+ * `VPADGetTPCalibratedPoint()`, prior to calling this function.
804+ */
805+ extern DECLSPEC SDL_bool SDLCALL SDL_WiiUSetSWKBDVPAD (const void * vpad );
806+
807+ /**
808+ * Sends KPAD input to the swkbd.
809+ *
810+ * Call this function at every frame if you call `KPADRead()` or `KPADReadEx()` in your
811+ * application, instead of using the SDL game controller subsystem.
812+ *
813+ * \param channel Number of channel.
814+ * \param kpad Pointer to a `KPADStatus` object.
815+ * \returns `SDL_TRUE` if the swkbd is visible and is going to use the input.
816+ */
817+ extern DECLSPEC SDL_bool SDLCALL SDL_WiiUSetSWKBDKPAD (int channel , const void * kpad );
818+
819+ #endif /* Wii U */
820+
615821/* Ends C function definitions when using C++ */
616822#ifdef __cplusplus
617823}
0 commit comments