This is a real quicky tutorial. I was playtesting a mod the other day
in Normal Quake, and was just so totally annoyed that Normal Quake
doesn't have the Windows clipboard paste (CTRL-V) that QuakeWorld does.
It is much easier to copy an ip in Windows, then paste it onto your
connect command, rather than have to remember the ip and retype it.
Anywho, all modifications take place in keys.c, so open it up and near the top you'll see: #include "quakedef.h" // 01-22-2000 FrikaC Begin PASTE #ifdef _WIN32 #include <windows.h> #endif // 01-22-2000 FrikaC End PASTE char *cmd; // 01-22-2000 FrikaC Begin PASTE #ifdef _WIN32 char *s; int i; HANDLE th; char *clipText, *textCopied; #endif // 01-22-2000 FrikaC End PASTE if (key < 32 || key > 127) return; // non printable // 01-22-2000 FrikaC Begin PASTE #ifdef _WIN32 if ((key=='V' || key=='v') && GetKeyState(VK_CONTROL)<0) { if (OpenClipboard(NULL)) { th = GetClipboardData(CF_TEXT); if (th) { clipText = GlobalLock(th); if (clipText) { textCopied = malloc(GlobalSize(th)+1); strcpy(textCopied, clipText); /* Substitutes a NULL for every token */strtok(textCopied, "\n\r\b"); i = strlen(textCopied); if (i+key_linepos>=MAXCMDLINE) i=MAXCMDLINE-key_linepos; if (i>0) { textCopied[i]=0; strcat(key_lines[edit_line], textCopied); key_linepos+=i;; } free(textCopied); } GlobalUnlock(th); } CloseClipboard(); return; } } #endif // 01-22-2000 FrikaC End PASTE |