class InputDeviceController extends ScriptableComponent
{
	private var m_isStarted : Bool;

	public static function Start( self : InputDeviceController )
	{
		if( self.m_isStarted )
		{
			return;
		}
		self.m_isStarted = true;
		RegisterListeners( self );
	}

	public static function Stop( self : InputDeviceController )
	{
		if( !( self.m_isStarted ) )
		{
			return;
		}
		self.m_isStarted = false;
		UnregsiterListeners( self );
	}

	private static function RegisterListeners( self : InputDeviceController )
	{
		var deviceBase : Device;
		deviceBase = ( ( Device )( self.GetOwner() ) );
		if( deviceBase )
		{
			self.GetOwner().RegisterInputListener( self, deviceBase.GetInputContextName() );
		}
	}

	private static function UnregsiterListeners( self : InputDeviceController )
	{
		var deviceBase : Device;
		deviceBase = ( ( Device )( self.GetOwner() ) );
		if( deviceBase )
		{
			self.GetOwner().UnregisterInputListener( self );
		}
	}

	protected event OnAction( action : ListenerAction, consumer : ListenerActionConsumer ) {}
}

