Skip to content

[rcore] Add GetClipboardText support on android - #6428

Merged
raysan5 merged 3 commits into
raysan5:masterfrom
emecdelam:master
Nov 18, 2026
Merged

raysan5 merged 3 commits into
raysan5:masterfrom
emecdelam:master

Conversation

@emecdelam

Copy link
Copy Markdown
Contributor

This pr implements GetCLipboardText in rcore_android.c

It has been tested in the emulator aswell as on a real phone (android 12)

2026-11-18.14-36-20.mp4
Test code used :
#include "raylib.h"

int main()
{
    InitWindow(800, 400, "Test");
    SetTargetFPS(60);
    const char* currentClipboard = "NONE";
    while (!WindowShouldClose())
    {
        Rectangle button = { (float)GetScreenWidth() / 2.0f - 50, (float)GetScreenHeight()/ 2.0f - 30, 100, 60 };

        bool hovered = CheckCollisionPointRec(GetMousePosition(), button);
        if (hovered && IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
            currentClipboard = GetClipboardText();
        }


        BeginDrawing();
            ClearBackground(RAYWHITE);

            DrawRectangleRec(button, hovered ? SKYBLUE : LIGHTGRAY);
            DrawRectangleLinesEx(button, 2, DARKGRAY);

            int textWidth = MeasureText("Click me", 20);
            DrawText("Click me", button.x + (button.width - textWidth)/2, button.y + 20, 20, BLACK);

            DrawText(TextFormat("Clipboard : %s", currentClipboard), 100, 100, 20, BLACK);

        EndDrawing();
    }

    CloseWindow();
    return 0;
}
</details>

@emecdelam emecdelam changed the title [rcore] Adds GetClipboardText support on android [rcore] Add GetClipboardText support on android Nov 18, 2026
@raysan5
raysan5 merged commit 436609a into raysan5:master Nov 18, 2026
16 checks passed
@raysan5

raysan5 commented Nov 18, 2026

Copy link
Copy Markdown
Owner

@emecdelam thanks for the improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants