Extract mpv/key to input
To separate the concern from `mpv`
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import gleam/erlang/atom
|
||||
import gleam/list
|
||||
|
||||
import mpv/internal/key as internal_key
|
||||
import input/internal as internal_input
|
||||
|
||||
pub type Key {
|
||||
Char(String)
|
||||
@@ -40,11 +40,11 @@ pub fn from_list(l: List(String)) -> Key {
|
||||
pub fn start_raw_shell() {
|
||||
let no_shell = atom.create("noshell")
|
||||
let raw = atom.create("raw")
|
||||
internal_key.shell_start_interactive(#(no_shell, raw))
|
||||
internal_input.shell_start_interactive(#(no_shell, raw))
|
||||
}
|
||||
|
||||
pub fn read_input_until_key(l: List(String)) -> Key {
|
||||
let l = internal_key.read_input() |> list.wrap |> list.append(l, _)
|
||||
let l = internal_input.read_input() |> list.wrap |> list.append(l, _)
|
||||
|
||||
case from_list(l) {
|
||||
Continue -> read_input_until_key(l)
|
||||
@@ -2,8 +2,8 @@ import gleam/json
|
||||
import gleam/result
|
||||
import gleam/string
|
||||
|
||||
import input/key.{type Key, Char}
|
||||
import mpv/internal/control as internal_control
|
||||
import mpv/key.{type Key, Char}
|
||||
import tcp/reason.{type Reason}
|
||||
import tcp/tcp.{type Socket}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import gleam/otp/actor
|
||||
import gleam/result
|
||||
import gleam/string
|
||||
|
||||
import input/key
|
||||
import mpv/control.{type Control}
|
||||
import mpv/key
|
||||
import tcp/reason
|
||||
import tcp/tcp.{type Socket}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import gleam/list
|
||||
import gleeunit
|
||||
|
||||
import mpv/key.{type Key, Char, csi, esc}
|
||||
import input/key.{type Key, Char, csi, esc}
|
||||
|
||||
pub fn main() -> Nil {
|
||||
gleeunit.main()
|
||||
@@ -1,9 +1,9 @@
|
||||
import gleam/list
|
||||
import gleeunit
|
||||
|
||||
import input/key.{type Key, Char}
|
||||
import mpv/control.{type Control}
|
||||
import mpv/internal/control as control_internal
|
||||
import mpv/key.{type Key, Char}
|
||||
|
||||
pub fn main() -> Nil {
|
||||
gleeunit.main()
|
||||
|
||||
Reference in New Issue
Block a user