Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lighthouse-client/examples/input_events.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
use clap::Parser;
use futures::StreamExt;
use lighthouse_client::{protocol::Authentication, Lighthouse, Result, TokioWebSocket, LIGHTHOUSE_URL};
use lighthouse_protocol::Model;
use tracing::info;

async fn run(lh: Lighthouse<TokioWebSocket>) -> Result<()> {
info!("Connected to the Lighthouse server");

// Stream input events
let mut stream = lh.stream_model().await?;
let mut stream = lh.stream_input().await?;
while let Some(msg) = stream.next().await {
if let Model::InputEvent(event) = msg?.payload {
info!("Got input event: {:?}", event)
}
let event = msg?.payload;
info!("Got input event: {:?}", event);
}

Ok(())
Expand Down