aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/main.c b/tests/main.c
index 51487dc..a9aebec 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -255,6 +255,17 @@ int main(int argc, char **argv) {
break;
}
case MGL_EVENT_KEY_PRESSED: {
+ if(event.key.code == MGL_KEY_C) {
+ mgl_window_set_clipboard(&window, "hello", 5);
+ fprintf(stderr, "Copied 'hello' to the clipboard\n");
+ } else if(event.key.code == MGL_KEY_V) {
+ char *str;
+ size_t size;
+ if(mgl_window_get_clipboard(&window, &str, &size)) {
+ fprintf(stderr, "Copied '%s' from the clipboard\n", str);
+ free(str);
+ }
+ }
fprintf(stderr, "key press event, code: %u\n", event.key.code);
break;
}