Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
26
vendor/crossterm_winapi/examples/console.rs
vendored
Normal file
26
vendor/crossterm_winapi/examples/console.rs
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#[cfg(windows)]
|
||||
use std::io::Result;
|
||||
|
||||
#[cfg(windows)]
|
||||
use crossterm_winapi::ConsoleMode;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn change_console_mode() -> Result<()> {
|
||||
let console_mode = ConsoleMode::new()?;
|
||||
|
||||
// get the current console mode:
|
||||
let _mode: u32 = console_mode.mode()?;
|
||||
|
||||
// set the console mode (not sure if this is an actual value xp)
|
||||
console_mode.set_mode(10)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn main() -> Result<()> {
|
||||
change_console_mode()
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn main() {
|
||||
println!("This example is for the Windows platform only.");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue