KXL_GetEvents
Author: kacchan

Prev Top Next

Name
KXL_GetEvents
Synopsis

    KXL_GetEvents -- Get of the generated event is carried out.

Description

    Uint32 KXL_CheckEvents(void);

Arguments
Nothing.
Return Value

KXL_EVENT_KEY_PRESS | When a key is press.
KXL_EVENT_KEY_RELEASE | When a key is release.
KXL_EVENT_BUTTON_PRESS | When a mouse button is press.
KXL_EVENT_BUTTON_RELEASE | When a mouse button is release.
KXL_EVENT_BUTTON_MOTION | When a moves pressing mouse button.
KXL_EVENT_EXPOSE | When a demand of re-drawing.

Exsample

    #include <KXL.h>

    int main(void)
    {
      Bool flag = False;

      KXL_CreateWindow(100, 100, "kxl.org",
                       KXL_EVENT_KEY_PRESS_MASK |
                       KXL_EVENT_EXPOSURE_MASK |
                       KXL_EVENT_BUTTON_PRESS_MASK);

      while (flag == False) {
        while (KXL_CheckEvents() == False);
        switch (KXL_GetEvents()) {
        case KXL_EVENT_EXPOSE:
          fprintf(stderr, "exposure\n");
          break;
        case KXL_EVENT_KEY_PRESS:
          fprintf(stderr, "key press\n");
          break;
        case KXL_EVENT_BUTTON_PRESS:
          fprintf(stderr, "mouse button press\n");
          flag = True;
          break;
        }
      }
      KXL_DeleteWindow();
      return 0;
    }