Ignore:
Timestamp:
Apr 1, 2006, 4:44:09 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Merged caca_wait_event() into caca_get_event() and added a timeout parameter to do what both functions did before, and even more.
Location:
libcaca/trunk/test
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/colors.c

    r681 r710  
    5151
    5252    caca_display(kk);
    53     caca_wait_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     53    caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, -1);
    5454
    5555    caca_detach(kk);
  • libcaca/trunk/test/demo.c

    r690 r710  
    7575        int menu = 0, mouse = 0, xmouse = 0, ymouse = 0;
    7676
    77         while(caca_get_event(kk, CACA_EVENT_ANY, &ev))
     77        while(caca_get_event(kk, CACA_EVENT_ANY, &ev, 0))
    7878        {
    7979            if(demo && (ev.type & CACA_EVENT_KEY_PRESS))
     
    149149                ymouse = ev.data.mouse.y;
    150150            }
     151            else if(ev.type & CACA_EVENT_RESIZE)
     152            {
     153                mouse = 1; /* old hack */
     154            }
    151155        }
    152156
     
    157161            {
    158162                cucul_set_color(qq, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
    159                 cucul_putstr(qq, xmouse, ymouse, "|\\");
     163                cucul_putstr(qq, xmouse, ymouse,     ".");
     164                cucul_putstr(qq, xmouse, ymouse + 1, "|\\");
    160165            }
    161166            caca_display(kk);
  • libcaca/trunk/test/dithering.c

    r681 r710  
    125125    caca_display(kk);
    126126
    127     caca_wait_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     127    caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, -1);
    128128
    129129    caca_detach(kk);
  • libcaca/trunk/test/event.c

    r681 r710  
    5555        struct caca_event ev;
    5656        static char const * quit_string[] = { "", "q", "qu", "qui", "quit" };
    57         int ret = caca_wait_event(kk, CACA_EVENT_ANY, &ev);
     57        int ret = caca_get_event(kk, CACA_EVENT_ANY, &ev, -1);
    5858
    5959        if(!ret)
     
    7878            events[0] = ev;
    7979
    80             ret = caca_get_event(kk, CACA_EVENT_ANY, &ev);
     80            ret = caca_get_event(kk, CACA_EVENT_ANY, &ev, 0);
    8181        }
    8282        while(ret);
  • libcaca/trunk/test/gamma.c

    r681 r710  
    6363    for(x = 0; ; x++)
    6464    {
    65         int ret = caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     65        int ret = caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, 0);
    6666
    6767        if(ret)
  • libcaca/trunk/test/hsv.c

    r681 r710  
    5454    caca_display(kk);
    5555
    56     caca_wait_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     56    caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, 0);
    5757
    5858    caca_detach(kk);
  • libcaca/trunk/test/spritedit.c

    r681 r710  
    5858        char buf[BUFSIZ];
    5959
    60         while(caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev))
     60        while(caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, 0))
    6161        {
    6262            switch(ev.data.key.c)
  • libcaca/trunk/test/transform.c

    r681 r710  
    109109    caca_display(kk);
    110110
    111     caca_wait_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     111    caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, -1);
    112112
    113113    caca_detach(kk);
  • libcaca/trunk/test/unicode.c

    r681 r710  
    8888    caca_display(kk);
    8989
    90     caca_wait_event(kk, CACA_EVENT_KEY_PRESS, &ev);
     90    caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, -1);
    9191
    9292    caca_detach(kk);
Note: See TracChangeset for help on using the changeset viewer.