sdlGetTextInputArea function

bool sdlGetTextInputArea(
  1. Pointer<SdlWindow> window,
  2. Pointer<SdlRect> rect,
  3. Pointer<Int32> cursor
)

Get the area used to type Unicode text input.

This returns the values previously set by SDL_SetTextInputArea().

\param window the window for which to query the text input area. \param rect a pointer to an SDL_Rect filled in with the text input area, may be NULL. \param cursor a pointer to the offset of the current cursor location relative to rect->x, may be NULL. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_SetTextInputArea

extern SDL_DECLSPEC bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor)

Implementation

bool sdlGetTextInputArea(
    Pointer<SdlWindow> window, Pointer<SdlRect> rect, Pointer<Int32> cursor) {
  final sdlGetTextInputAreaLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlWindow> window, Pointer<SdlRect> rect,
          Pointer<Int32> cursor),
      int Function(Pointer<SdlWindow> window, Pointer<SdlRect> rect,
          Pointer<Int32> cursor)>('SDL_GetTextInputArea');
  return sdlGetTextInputAreaLookupFunction(window, rect, cursor) == 1;
}