src/video/android/SDL_androidclipboard.c
author Sam Lantinga <slouken@libsdl.org>
Wed, 26 Sep 2012 20:14:37 -0700
changeset 6464 ab55284b389f
child 6888 e87e7a7b9d08
permissions -rw-r--r--
Fixed bug 1573 - SDL does not support system clipboard on Android.

Philipp Wiesemann 2012-08-18 14:09:47 PDT

there is currently no way in SDL to interact with the system clipboard on
Android.

I attached a patch which tries to implement the three clipboard functions for
Android. It does not add the CLIPBOARDUPDATE event because this seems to
require Android API 11 or polling.
     1 #include "SDL_config.h"
     2 
     3 #if SDL_VIDEO_DRIVER_ANDROID
     4 
     5 #include "SDL_androidvideo.h"
     6 
     7 #include "../../core/android/SDL_android.h"
     8 
     9 int
    10 Android_SetClipboardText(_THIS, const char *text)
    11 {
    12 	return Android_JNI_SetClipboardText(text);
    13 }
    14 
    15 char *
    16 Android_GetClipboardText(_THIS)
    17 {
    18 	return Android_JNI_GetClipboardText();
    19 }
    20 
    21 SDL_bool Android_HasClipboardText(_THIS)
    22 {
    23 	return Android_JNI_HasClipboardText();
    24 }
    25 
    26 #endif /* SDL_VIDEO_DRIVER_ANDROID */