- Added GUICapture mouse events for Win32.
SVN r1415 (trunk)
This commit is contained in:
parent
025e36ee41
commit
05a8a49ea5
3 changed files with 47 additions and 14 deletions
|
|
@ -38,6 +38,8 @@
|
|||
#define HU_INPUTX 0
|
||||
#define HU_INPUTY (0 + (screen->Font->GetHeight () + 1))
|
||||
|
||||
void CT_PasteChat(const char *clip);
|
||||
|
||||
EXTERN_CVAR (Int, con_scaletext)
|
||||
|
||||
EXTERN_CVAR (Bool, sb_cooperative_enable)
|
||||
|
|
@ -150,20 +152,7 @@ bool CT_Responder (event_t *ev)
|
|||
}
|
||||
else if (ev->data1 == 'V' && (ev->data3 & GKM_CTRL))
|
||||
{
|
||||
FString clip = I_GetFromClipboard ();
|
||||
if (clip.IsNotEmpty())
|
||||
{
|
||||
// Only paste the first line.
|
||||
const char *clip_p = clip;
|
||||
while (*clip_p)
|
||||
{
|
||||
if (*clip_p == '\n' || *clip_p == '\r' || *clip_p == '\b')
|
||||
{
|
||||
break;
|
||||
}
|
||||
CT_AddChar (*clip_p++);
|
||||
}
|
||||
}
|
||||
CT_PasteChat(I_GetFromClipboard());
|
||||
}
|
||||
}
|
||||
else if (ev->subtype == EV_GUI_Char)
|
||||
|
|
@ -180,11 +169,37 @@ bool CT_Responder (event_t *ev)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
else if (ev->subtype == EV_GUI_MButtonDown)
|
||||
{
|
||||
CT_PasteChat(I_GetFromClipboard());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// CT_PasteChat
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void CT_PasteChat(const char *clip)
|
||||
{
|
||||
if (clip != NULL)
|
||||
{
|
||||
// Only paste the first line.
|
||||
while (*clip != '\0')
|
||||
{
|
||||
if (*clip == '\n' || *clip == '\r' || *clip == '\b')
|
||||
{
|
||||
break;
|
||||
}
|
||||
CT_AddChar (*clip++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// CT_Drawer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue