Compare commits
4 Commits
89a6f09a90
...
d1053f687b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1053f687b | ||
|
|
53f877f03d | ||
|
|
efc0604c1d | ||
|
|
a048e084e7 |
@@ -102,7 +102,7 @@ fn handle_message(
|
|||||||
/// This is useful to ultimately create a `Control` without the user having to
|
/// This is useful to ultimately create a `Control` without the user having to
|
||||||
/// input all of the character(s) needed.
|
/// input all of the character(s) needed.
|
||||||
fn read_input(
|
fn read_input(
|
||||||
subject: Subject(Control),
|
agent: Subject(Control),
|
||||||
inject_input: Subject(Key),
|
inject_input: Subject(Key),
|
||||||
tap_input: Subject(List(String)),
|
tap_input: Subject(List(String)),
|
||||||
) -> Nil {
|
) -> Nil {
|
||||||
@@ -111,10 +111,13 @@ fn read_input(
|
|||||||
Ok(_) | Error(_) -> []
|
Ok(_) | Error(_) -> []
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ =
|
case
|
||||||
key.read_input_until_key(buffer, tap_input)
|
key.read_input_until_key(buffer, tap_input)
|
||||||
|> control.from_key
|
|> control.from_key
|
||||||
|> result.map(process.send(subject, _))
|
{
|
||||||
|
Error(_) -> Nil
|
||||||
|
Ok(control) -> process.send(agent, control)
|
||||||
|
}
|
||||||
|
|
||||||
read_input(subject, inject_input, tap_input)
|
read_input(agent, inject_input, tap_input)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user