1
0

Implement CLIPBOARD

This commit is contained in:
otya128
2016-12-30 20:34:52 +09:00
parent a50e50c1e8
commit 537c0c1f75
2 changed files with 26 additions and 0 deletions

View File

@@ -1483,6 +1483,7 @@ class PetitComputer
char* cl = SDL_GetClipboardText();
string an = cast(string)(cl[0..core.stdc.string.strlen(cl)]);
ks = an.to!wstring;
SDL_free(cl);
}
}
console.print(ks);
@@ -1668,7 +1669,23 @@ class PetitComputer
{
this.console.initGRPF();
}
}
wstring clipboard()
{
if(SDL_HasClipboardText())
{
char* cl = SDL_GetClipboardText();
string an = cast(string)(cl[0..core.stdc.string.strlen(cl)]);
auto ret = an.to!wstring;
SDL_free(cl);
return ret;
}
return "";
}
void clipboard(wstring ws)
{
SDL_SetClipboardText(ws.to!string.toStringz);
}
//プチコン内部表現はRGB5_A1