Skip to content

[Proposal] New event type SDL_TextCandidate #4855

@jai-x

Description

@jai-x

Motivation

Consumers of SDL would like to display IME candidate text choices during a text
input context.

This is currently handled by making of use of SDL_SetTextInputRect which
indicates to the platform window backend and native IME where to display a
candidate list based on the textbox position.

This method currently does not draw when SDL is used in exclusive fullscreen
mode. Additionally, SDL consumers would like to display the candidate text in a
more integrated way in the window by being able to access and draw the candidate
text directly.

Proposal

New event type SDL_TextCandidate:

Field Datatype Comment
type Uint32 SDL_TEXTCANDIDATE
timestamp Uint32 Timestamp of the event
windowID Uint32 The window with keyboard focus, if any
candidates char** An array of null terminated UTF-8 encoded strings
count Sint32 The count of the number of strings in the candidates array
cursor Sint32 The index of which of the strings in the candidates array is being selected by the user

Feedback and implementation

If there is any feedback to this proposal that would be great.
I would be interested in implementing this myself once appropriate feedback has
been received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions