mirror of
https://github.com/crossterm-rs/crossterm.git
synced 2025-09-29 22:11:51 +00:00
18 lines
488 B
Rust
18 lines
488 B
Rust
//! Demonstrates how to match on modifiers like: Control, alt, shift.
|
|
//!
|
|
//! cargo run --example event-poll-read
|
|
|
|
use std::{io, time::Duration};
|
|
|
|
use crossterm::{
|
|
cursor::position,
|
|
event::{poll, read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
|
|
execute,
|
|
terminal::{disable_raw_mode, enable_raw_mode},
|
|
};
|
|
pub fn main() {
|
|
crossterm::terminal::enable_raw_mode().unwrap();
|
|
let result = crossterm::event::read();
|
|
eprintln!("RESULT: {:?}", result);
|
|
}
|