Add shared memory, keyboard events and PTY syscall
This commit is contained in:
parent
bd349c40e2
commit
fba21b5743
@ -212,8 +212,9 @@ impl KeyboardKey {
|
||||
}
|
||||
|
||||
impl KeyboardKeyEvent {
|
||||
/// Splits the event into its state and key
|
||||
#[inline]
|
||||
const fn split(self) -> (KeyboardKey, bool) {
|
||||
pub const fn split(self) -> (KeyboardKey, bool) {
|
||||
match self {
|
||||
Self::Pressed(k) => (k, true),
|
||||
Self::Released(k) => (k, false),
|
||||
|
@ -117,4 +117,19 @@ impl TerminalOptions {
|
||||
pub const fn is_canonical(&self) -> bool {
|
||||
self.line.contains(TerminalLineOptions::CANONICAL)
|
||||
}
|
||||
|
||||
/// Returns `true` if the terminal echoes the '\n' character
|
||||
pub fn is_echo_newline(&self) -> bool {
|
||||
self.line.contains_any(
|
||||
TerminalLineOptions::CANONICAL
|
||||
| TerminalLineOptions::ECHO
|
||||
| TerminalLineOptions::ECHO_NL,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for TerminalOptions {
|
||||
fn default() -> Self {
|
||||
Self::const_default()
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,12 @@ primitive_enum!(
|
||||
#[doc = "Send a message to a channel"]
|
||||
SendMessage = 22,
|
||||
|
||||
#[doc = "Creates a buffer of shared memory and returns a FD to it"]
|
||||
CreateSharedMemory = 23,
|
||||
|
||||
#[doc = "Creates a pair of pseudo-terminal master/slave"]
|
||||
CreatePty = 24,
|
||||
|
||||
#[doc = "Create and start a new process"]
|
||||
SpawnProcess = 40,
|
||||
#[doc = "Wait for a process to exit"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user