mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Allow Clipboard actions.
This commit is contained in:
parent
b776352e8e
commit
1164e6f657
1 changed files with 22 additions and 0 deletions
22
src/m_menu.c
22
src/m_menu.c
|
|
@ -10436,6 +10436,28 @@ static void M_HandleConnectIP(INT32 choice)
|
||||||
if (l >= 28-1)
|
if (l >= 28-1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
const char *paste = I_ClipboardPaste(); // Paste clipboard into char
|
||||||
|
|
||||||
|
if ( ctrldown ) {
|
||||||
|
switch (choice) {
|
||||||
|
case 118: // ctrl+v, pasting
|
||||||
|
if (paste != NULL)
|
||||||
|
strcat(setupm_ip, paste); // Concat the ip field with clipboard
|
||||||
|
setupm_ip[127] = 0; // Truncate to maximum length
|
||||||
|
break;
|
||||||
|
case 99: // ctrl+c, copying
|
||||||
|
I_ClipboardCopy(setupm_ip, l);
|
||||||
|
break;
|
||||||
|
case 120: // ctrl+x, cutting
|
||||||
|
I_ClipboardCopy(setupm_ip, l);
|
||||||
|
setupm_ip[0] = 0;
|
||||||
|
break;
|
||||||
|
default: // otherwise do nothing
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break; // break
|
||||||
|
}
|
||||||
|
|
||||||
// Rudimentary number and period enforcing - also allows letters so hostnames can be used instead
|
// Rudimentary number and period enforcing - also allows letters so hostnames can be used instead
|
||||||
if ((choice >= '-' && choice <= ':') || (choice >= 'A' && choice <= 'Z') || (choice >= 'a' && choice <= 'z'))
|
if ((choice >= '-' && choice <= ':') || (choice >= 'A' && choice <= 'Z') || (choice >= 'a' && choice <= 'z'))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue