mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
new command for -x11 and -glx: in_paste_buffer (eg in_bind imt_console
m_button3 in_paste_buffer). Makes X's clipboard available to quake (for pasting:)
This commit is contained in:
parent
8ae3ef9482
commit
4685fccbac
1 changed files with 20 additions and 5 deletions
|
@ -124,6 +124,23 @@ in_dga_f (cvar_t *var)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
in_paste_buffer_f (void)
|
||||
{
|
||||
char *bytes, *p;
|
||||
int num_bytes;
|
||||
|
||||
bytes = XFetchBytes (x_disp, &num_bytes);
|
||||
if (!num_bytes)
|
||||
return;
|
||||
// get bytes to keys.c
|
||||
for (p = bytes; num_bytes && *p; p++, num_bytes--) {
|
||||
Key_Event (QFK_UNKNOWN, *p, 1);
|
||||
Key_Event (QFK_UNKNOWN, 0, 0);
|
||||
}
|
||||
XFree (bytes);
|
||||
}
|
||||
|
||||
static void
|
||||
XLateKey (XKeyEvent * ev, int *k, int *u)
|
||||
{
|
||||
|
@ -546,11 +563,6 @@ IN_LL_Init (void)
|
|||
|
||||
if (!COM_CheckParm ("-nomouse")) {
|
||||
dga_avail = VID_CheckDGA (x_disp, NULL, NULL, NULL);
|
||||
//if (vid_fullscreen->int_val) {
|
||||
//Cvar_Set (in_grab, "1");
|
||||
//in_grab->flags |= CVAR_ROM;
|
||||
//IN_LL_Grab_Input ();
|
||||
//}
|
||||
|
||||
X11_AddEvent (ButtonPress, &event_button);
|
||||
X11_AddEvent (ButtonRelease, &event_button);
|
||||
|
@ -558,6 +570,9 @@ IN_LL_Init (void)
|
|||
|
||||
in_mouse_avail = 1;
|
||||
}
|
||||
|
||||
Cmd_AddCommand ("in_paste_buffer", in_paste_buffer_f,
|
||||
"Paste the contents of X's C&P buffer to the console");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue