Extract mpv/key to input
To separate the concern from `mpv`
This commit is contained in:
15
src/input/internal.gleam
Normal file
15
src/input/internal.gleam
Normal file
@@ -0,0 +1,15 @@
|
||||
import gleam/erlang/atom
|
||||
|
||||
pub fn read_input() -> String {
|
||||
io_get_chars("", 1)
|
||||
}
|
||||
|
||||
pub type NotUsed
|
||||
|
||||
// https://www.erlang.org/doc/apps/stdlib/shell.html#start_interactive/1
|
||||
@external(erlang, "shell", "start_interactive")
|
||||
pub fn shell_start_interactive(options: #(atom.Atom, atom.Atom)) -> NotUsed
|
||||
|
||||
// https://www.erlang.org/doc/apps/stdlib/io.html#get_line/1
|
||||
@external(erlang, "io", "get_chars")
|
||||
fn io_get_chars(prompt: String, count: Int) -> String
|
||||
Reference in New Issue
Block a user