Get clipboard data from SDL

This makes pasting in client console and UI edit fields work on X11 and OS X.

Sys_GetClipboardData is only used by client, so returning NULL in dedicated is fine.
This commit is contained in:
Zack Middleton 2014-08-27 04:17:39 -05:00
parent 077f6bd068
commit 137ddb9dc6
3 changed files with 29 additions and 37 deletions

View file

@ -190,33 +190,6 @@ char *Sys_GetCurrentUser( void )
return s_userName;
}
/*
================
Sys_GetClipboardData
================
*/
char *Sys_GetClipboardData( void )
{
char *data = NULL;
char *cliptext;
if ( OpenClipboard( NULL ) != 0 ) {
HANDLE hClipboardData;
if ( ( hClipboardData = GetClipboardData( CF_TEXT ) ) != 0 ) {
if ( ( cliptext = GlobalLock( hClipboardData ) ) != 0 ) {
data = Z_Malloc( GlobalSize( hClipboardData ) + 1 );
Q_strncpyz( data, cliptext, GlobalSize( hClipboardData ) );
GlobalUnlock( hClipboardData );
strtok( data, "\n\r\b" );
}
}
CloseClipboard();
}
return data;
}
#define MEM_THRESHOLD 96*1024*1024
/*