Extract mpv/key to input

To separate the concern from `mpv`
This commit is contained in:
Alexander Heldt
2025-11-18 18:39:20 +01:00
parent 417b5a2559
commit 1c47a84750
6 changed files with 7 additions and 7 deletions

15
src/input/internal.gleam Normal file
View 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