📄 xesetwiretoevent.html
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: Extensions: XESetWireToEvent</TITLE></HEAD><BODY><H1 ALIGN=center>XESetWireToEvent</H1><H2>Syntax</H2><!.IN "XESetWireToEvent" "" "@DEF@"><CODE><PRE>int (*XESetWireToEvent(<B>display</B>, <B>event_number</B>, <B>proc</B>))() <A HREF="../../display/opening.html#Display">Display</A> *<B>display</B>; int <B>event_number</B>; Status (*<B>proc</B>)();</PRE></CODE><H2>Arguments</H2><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>event_number</B><TD> Specifies the event code.<TR><TD> <B>proc</B><TD> Specifies the procedure to call when converting an event.</TABLE><H2>Description</H2>The<B>XESetWireToEvent()</B>function defines a procedure to be called when an eventneeds to be converted from wire format (<A HREF="hooks-into-the-library.html#xEvent">xEvent</A>)to host format (<B>XEvent</B>).The event number defines which protocol event number to install aconversion procedure for.<B>XESetWireToEvent()</B>returns any previously defined procedure.<P ALIGN=center><B>Note</B><BLOCKQUOTE>You can replace a core event conversion function with oneof your own, although this is not encouraged.It would, however, allow you to intercept a core event and modify it before being placed in the queue or otherwise examined.</BLOCKQUOTE>When Xlib needs to convert an event from wire format to hostformat, your procedure is called with these arguments:<P><PRE><CODE><B><A HREF="../../introduction/errors.html#Status">Status</A></B> (*<B>proc</B>)(<B>display</B>, <B>re</B>, <B>event</B>) <A HREF="../../display/opening.html#Display">Display</A> *<B>display</B>; <A HREF="../../events/structures.html#XEvent">XEvent</A> *<B>re</B>; <A HREF="hooks-into-the-library.html#xEvent">xEvent</A> *<B>event</B>;</PRE></CODE><P>Your procedure must return status to indicate if the conversion succeeded.The re argument is a pointer to where the host format event should be stored,and the event argument is the 32-byte wire event structure.In the <A HREF="../../events/structures.html#XEvent">XEvent</A> structure you are creating, you must fill in the five required members of the event structure.You should fill in the type member with the type specified for the <A HREF="hooks-into-the-library.html#xEvent">xEvent</A> structure.You should copy all other members from the <A HREF="hooks-into-the-library.html#xEvent">xEvent</A> structure (wire format) to the<A HREF="../../events/structures.html#XEvent">XEvent</A> structure (host format).Your conversion procedure should return <B>True</B>if the event should be placed in the queue or<B>False</B>if it should not be placed in the queue.<H2>See also</H2><B><A HREF="XESetBeforeFlush.html">XESetBeforeFlush()</A></B>,<B><A HREF="XESetCloseDisplay.html">XESetCloseDisplay()</A></B>,<B><A HREF="XESetCopyGC.html">XESetCopyGC()</A></B>,<B><A HREF="XESetCreateFont.html">XESetCreateFont()</A></B>,<B><A HREF="XESetCreateGC.html">XESetCreateGC()</A></B>,<B><A HREF="XESetError.html">XESetError()</A></B>,<B><A HREF="XESetErrorString.html">XESetErrorString()</A></B>,<B><A HREF="XESetEventToWire.html">XESetEventToWire()</A></B>,<B><A HREF="XESetFlushGC.html">XESetFlushGC()</A></B>,<B><A HREF="XESetFreeFont.html">XESetFreeFont()</A></B>,<B><A HREF="XESetFreeGC.html">XESetFreeGC()</A></B>,<B><A HREF="XESetPrintErrorValues.html">XESetPrintErrorValues()</A></B>,<B><A HREF="XESetWireToError.html">XESetWireToError()</A></B>,<B><A HREF="_XSetLastRequestRead.html">_XSetLastRequestRead()</A></B>,"<A HREF="hooks-into-the-library.html">Hooks into the Library</A>"<HR><ADDRESS><A HREF="http://tronche.com/">Christophe Tronche</A>, <A HREF="mailto:ch.tronche@computer.org">ch.tronche@computer.org</A></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -