mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-10 19:33:28 +00:00
add clipboard feature to entry
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@611 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -107,6 +107,20 @@ static void key(MwWidget handle, int code) {
|
||||
} else if(code == MwLLKeyEnter) {
|
||||
MwDispatchUserHandler(handle, MwNactivateHandler, NULL);
|
||||
} else if(code == (MwLLControlMask | 'v')){
|
||||
char* c = MwLLGetClipboard(handle->lowlevel);
|
||||
if(c != NULL){
|
||||
char* out = malloc(strlen(str) + strlen(c) + 1);
|
||||
|
||||
MwUTF8Copy(str, 0, out, 0, t->cursor);
|
||||
MwUTF8Copy(c, 0, out, t->cursor, MwUTF8Length(c));
|
||||
MwUTF8Copy(str, t->cursor, out, t->cursor + MwUTF8Length(c), MwUTF8Length(str) - t->cursor);
|
||||
|
||||
t->cursor += MwUTF8Length(c);
|
||||
|
||||
MwSetText(handle, MwNtext, out);
|
||||
free(out);
|
||||
free(c);
|
||||
}
|
||||
} else if(!(code & MwLLKeyMask)) {
|
||||
int incr = 0;
|
||||
out = malloc(strlen(str) + 5 + 1);
|
||||
|
||||
Reference in New Issue
Block a user