Ejemplo n.º 1
0
/**
 * \brief Handler for Button 3 rising edge interrupt.
 * \param id The button ID.
 * \param mask The button mask.
 */
static void button3_handler(uint32_t id, uint32_t mask)
{
	if ((OLED1_PIN_PUSHBUTTON_3_ID == id) &&
			(OLED1_PIN_PUSHBUTTON_3_MASK == mask)) {
		process_button_event(3);
	}
}
Ejemplo n.º 2
0
void
JoystickKeyboardController::process_event(const SDL_Event& event)
{
  switch(event.type) {
    case SDL_KEYUP:
    case SDL_KEYDOWN:
      process_key_event(event.key);
      break;

    case SDL_JOYAXISMOTION:
      process_axis_event(event.jaxis);
      break;

    case SDL_JOYHATMOTION:
      process_hat_event(event.jhat);
      break;

    case SDL_JOYBUTTONDOWN:
    case SDL_JOYBUTTONUP:
      process_button_event(event.jbutton);
      break;

    default:
      break;
  }
}
Ejemplo n.º 3
0
void
GUIScreen::update (const Input::Event& event)
{
  // Dispatch the recieved input events
  gui_manager->update(event);

  switch (event.type)
  {
    case Input::POINTER_EVENT_TYPE:
    {
      // ignored cause this is handled in the gui_manager
    }
    break;

    case Input::BUTTON_EVENT_TYPE:
    {
      process_button_event (event.button);
    }
    break;

    case Input::AXIS_EVENT_TYPE:
    {
      if (event.axis.name == Input::ACTION_AXIS)
      {
        on_action_axis_move(event.axis.dir);
      }
    }
    break;

    case Input::SCROLLER_EVENT_TYPE:
    {

    }
    break;
                
    case Input::KEYBOARD_EVENT_TYPE:
    {
                
    }
    break;

    case Input::TEXT_INPUT_EVENT_TYPE:
    {
                
    }
    break;

    default:
      log_error("unhandled event type: %1%", event.type);
      break;
  }
}