Login
Immutable PageDiscussionInfoAttachments
Diff for "clear/note/2012-05"

MMA
Differences between revisions 1 and 2
Revision 1 as of 2012-05-01 01:00:36
Size: 520
Editor: clear
Comment:
Revision 2 as of 2012-05-01 01:01:06
Size: 531
Editor: clear
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
{{{#!highlight c {{{#!highlight c numbers=no

2012年5月

05/01

XPeekEvent

Windows APIのPeekMessage()はメッセージがない場合ただちに返ってくるが、XlibのXPeekEvent()はイベントが来るまでブロックするらしい。XlibでPeekMessage()相当のことをやりたい時はXPending()+XNextEvent()でできそう。

for (;;) {
    if (XPending(dpy)) {
        XNextEvent(dpy, &ev);
        /* ... */
    } else {
        /* イベントがないときの処理 */
    }
}

clear/note/2012-05 (last edited 2012-05-31 03:01:20 by clear)