select_action (p_request request)
{
  select ()
  {
    case request->scan_code == SC_LEFT:  return DO_MOVE_LEFT;
    case request->scan_code == SC_RIGHT: return DO_MOVE_RIGHT;
    case request->scan_code == SC_UP:    return DO_MOVE_UP;
    case request->scan_code == SC_DOWN:  return DO_MOVE_DOWN;
  }
  else
  {
    return DO_ERR_REQUEST;
  }
}