pub fn listen( pads: &mut Vec<Gamepad> )
	{
		let mut gpads   = Gilrs::new().unwrap();
		let     pad     = pads.first_mut().unwrap();


		loop
		{
			while let Some( Event { id: _, event, time: _ } ) = gpads.next_event()
			{
				pad.process_event( event.into() );
			}


			pad.process_event( EventType::NoChange );


			thread::sleep( Duration::from_millis ( Self::SLEEP_MS ) );
		}
	}
/// Listens to the event loop of gilrs. This will loop and will not return. Eg. Blocks the current thread.
///
/// TODO: make a working system for when there is more than 1 gamepad connected.
///
Listens to the event loop of gilrs. This will loop and will not return. Eg. Blocks the current thread.
TODO: make a working system for when there is more than 1 gamepad connected.
Listens to the event loop of gilrs . This will loop and will not return . Eg . Blocks the current thread . TODO : make a working system for when there is more than 1 gamepad connected .
pub fn listen( pads: &mut Vec<Gamepad> )
	{
		let mut gpads   = Gilrs::new().unwrap();
		let     pad     = pads.first_mut().unwrap();
		loop
		{
			while let Some( Event { id: _, event, time: _ } ) = gpads.next_event()
			{
				pad.process_event( event.into() );
			}
			pad.process_event( EventType::NoChange );
			thread::sleep( Duration::from_millis ( Self::SLEEP_MS ) );
		}
	}
pub fn listen ( pads : & mut Vec < Gamepad > ) { let mut gpads = Gilrs :: new ( ) . unwrap ( ) ; let pad = pads . first_mut ( ) . unwrap ( ) ; loop { while let Some ( Event { id : _ , event , time : _ } ) = gpads . next_event ( ) { pad . process_event ( event . into ( ) ) ; } pad . process_event ( EventType :: NoChange ) ; thread :: sleep ( Duration :: from_millis ( Self :: SLEEP_MS ) ) ; } }
Listens to the event loop of gilrs.
Listens to the event loop of gilrs .
pads
&mut Vec<Gamepad>
pads
&mut Vec<Gamepad>