Represents all the events that happen in glerminal, such as keyboard events, mouse events, resize, and close events.
use glerminal::{TerminalBuilder, VirtualKeyCode, TextBuffer};
let terminal = TerminalBuilder::new()
.with_title("Hello GLerminal!")
.with_dimensions((1280, 720))
.build();
let mut text_buffer;
match TextBuffer::new(&terminal, (80, 24)) {
Ok(buffer) => text_buffer = buffer,
Err(error) => panic!(format!("Failed to initialize text buffer: {}", error)),
}
let events = terminal.get_current_events();
println!("Was A just pressed: {}", events.keyboard.was_just_pressed(VirtualKeyCode::A));
println!("Cursor position: {:?}", events.cursor.get_location(&text_buffer));
Represents keyboard events.
Allows getting information related to cursor position
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static