Listing 8

handle_event any_event(event_answer a) {
  switch ( msg.msg) {
    case WM_MOUSEMOVE:
    case WM_LBUTTONDOWN:
    case WM_LBUTTONUP:
    case WM_RBUTTONDOWN:
    case WM_MBUTTONDOWN:
    case WM_RBUTTONUP:
    case WM_MBUTTONUP:
    case WM_NCHITTEST:
      // we got a mouse event!
      return;
  }
  a = event_not_handled;
  return event<0>().HANDLED_BY(&me::any_event);
}