title: Reading the Position of a Mouse click in Bevy
body: <p>I am trying to see where the mouse is pressed so I can select my character.
  I have tried the following</p>
  <pre class="lang-rust prettyprint-override"><code>#[derive(Default)]
  struct State { // Set up from example
      mouse_button_event_reader: EventReader&lt;MouseButtonInput&gt;,
      cursor_moved_event_reader: EventReader&lt;CursorMoved&gt;,
  }
  
  fn select_character(
      mut state: ResMut&lt;State&gt;,
      mouse_button_input_events: Res&lt;Events&lt;MouseButtonInput&gt;&gt;,
      cursor_moved_events: Res&lt;Events&lt;CursorMoved&gt;&gt;,
  ) {
  
      for (cursor_event, mouse_event) in state
          .cursor_moved_event_reader
          .iter(&amp;cursor_moved_events)
          .zip(
              state
                  .mouse_button_event_reader
                  .iter(&amp;mouse_button_input_events),
          )
      {
          println!(&quot;{:?}&quot;, cursor_event);
          println!(&quot;{:?}&quot;, mouse_event);
      }
  }
  </code></pre>
  <p>This kind of works, but the mouse needs to be moving while it is clicked. Is there a way of getting the position once the mouse is pressed?</p>
  <p>Edit:</p>
  <p>I thought <code>.find_latest</code> might work, getting it to return the latest <code>Some</code> value.</p>
  <pre class="lang-rust prettyprint-override"><code>for event in state
          .mouse_button_event_reader
          .iter(&amp;mouse_button_input_events)
      {
          let cursor_event = state
              .cursor_moved_event_reader
              .find_latest(&amp;cursor_moved_events, |x| x.is_Some() // Not sure how to only return values that are Some(x)
          );
          println!(&quot;{:?}&quot;, event);
          println!(&quot;{:?}&quot;, cursor_event);
      }
  </code></pre>