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