Esempio n. 1
0
sge::input::joypad::axis_code
sge::evdev::joypad::relative_axis::make_code(
	sge::evdev::device::event_type const _event
)
{
	switch(
		_event.get()
	)
	{
	case REL_X:
		return sge::input::joypad::axis_code::x;
	case REL_Y:
		return sge::input::joypad::axis_code::y;
	case REL_Z:
		return sge::input::joypad::axis_code::z;
	case REL_RX:
	case REL_RY:
	case REL_RZ:
	case REL_HWHEEL:
	case REL_DIAL:
	case REL_WHEEL:
	case REL_MISC:
	default:
		return sge::input::joypad::axis_code::unknown;
	}

	FCPPT_ASSERT_UNREACHABLE;
}
Esempio n. 2
0
sge::input::joypad::axis_code
sge::evdev::joypad::absolute_axis::make_code(
	sge::evdev::device::event_type const _event
)
{
	switch(
		_event.get()
	)
	{
	case ABS_X:
		return sge::input::joypad::axis_code::x;
	case ABS_Y:
		return sge::input::joypad::axis_code::y;
	case ABS_Z:
		return sge::input::joypad::axis_code::z;
	case ABS_RX:
	case ABS_RY:
	case ABS_RZ:
	case ABS_THROTTLE:
	case ABS_RUDDER:
	case ABS_WHEEL:
	case ABS_GAS:
	case ABS_BRAKE:
	case ABS_HAT0X:
	case ABS_HAT0Y:
	case ABS_HAT1X:
	case ABS_HAT1Y:
	case ABS_HAT2X:
	case ABS_HAT2Y:
	case ABS_HAT3X:
	case ABS_HAT3Y:
	case ABS_PRESSURE:
	case ABS_DISTANCE:
	case ABS_TILT_X:
	case ABS_TILT_Y:
	case ABS_TOOL_WIDTH:
	case ABS_VOLUME:
	case ABS_MISC:
	// TODO: discard multi touch stuff?
	case ABS_MT_SLOT:
	case ABS_MT_TOUCH_MAJOR:
	case ABS_MT_TOUCH_MINOR:
	case ABS_MT_WIDTH_MAJOR:
	case ABS_MT_WIDTH_MINOR:
	case ABS_MT_ORIENTATION:
	case ABS_MT_POSITION_X:
	case ABS_MT_POSITION_Y:
	case ABS_MT_TOOL_TYPE:
	case ABS_MT_BLOB_ID:
	case ABS_MT_TRACKING_ID:
	case ABS_MT_PRESSURE:
	case ABS_MT_DISTANCE:
	default:
		return sge::input::joypad::axis_code::unknown;
	}

	FCPPT_ASSERT_UNREACHABLE;
}