class
Opal::Asciicast::Driver
- Opal::Asciicast::Driver
- Opal::Terminal::Driver
- Reference
- Object
Overview
Headless terminal driver that records all screen output directly into an Asciinema v2 recording (.cast) stream. Allows any Opal application, TEA program, form wizard, or interactive UI to be driven and recorded headlessly.
Defined in:
opal/asciicast/driver.crConstructors
Instance Method Summary
- #event_queue : Array(Terminal::KeyEvent | Terminal::MouseEvent | Terminal::ResizeEvent)
- #event_queue=(event_queue : Array(Terminal::KeyEvent | Terminal::MouseEvent | Terminal::ResizeEvent))
- #flush : Nil
- #in_raw_mode? : Bool
-
#inject_event(event : Terminal::KeyEvent | Terminal::MouseEvent | Terminal::ResizeEvent) : self
Injects a keyboard or mouse event into the driver's input stream
-
#inject_key(name : String, char : Char | Nil = nil, ctrl : Bool = false, alt : Bool = false, shift : Bool = false) : self
Convenience helper: injects a keyboard event
-
#inject_mouse(x : Int32, y : Int32, button : Terminal::MouseButton = Terminal::MouseButton::Left, action : Terminal::MouseAction = Terminal::MouseAction::Press) : self
Convenience helper: injects a mouse event
-
#pause(seconds : Float64) : self
Pauses recording timeline
-
#poll_event(timeout_ms : Int32 = 0) : Terminal::KeyEvent | Terminal::MouseEvent | Terminal::ResizeEvent | Nil
Non-blocking or timed check for input/resize events.
-
#raw_mode(&)
Simulates entering raw mode
-
#read_event : Terminal::KeyEvent | Terminal::MouseEvent | Terminal::ResizeEvent | Nil
Reads the next simulated or injected input event
-
#save(filename : String) : Nil
Saves the recorded session to a .cast file
-
#size : Tuple(Int32, Int32)
Terminal dimensions from writer header
- #time_advance : Float64
- #time_advance=(time_advance : Float64)
-
#to_s(io : IO) : Nil
Returns the complete recorded asciicast content
-
#to_s : String
Returns a nicely readable and concise string representation of this object, typically intended for users.
-
#write(str : String) : Nil
Records an output chunk to the asciicast timeline
- #writer : Writer
Instance methods inherited from class Opal::Terminal::Driver
check_resize : ResizeEvent | Nil
check_resize,
clear : Nil
clear,
disable_mouse : Nil
disable_mouse,
enable_mouse : Nil
enable_mouse,
enter_alternate_screen : Nil
enter_alternate_screen,
exit_alternate_screen : Nil
exit_alternate_screen,
flush : Nil
flush,
flush_input : Nil
flush_input,
hide_cursor : Nil
hide_cursor,
input : IO
input,
input=(input : IO)
input=,
move_to(row : Int32, col : Int32) : Nil
move_to,
on_resize : Proc(Int32, Int32, Nil) | Nil
on_resize,
on_resize=(on_resize : Proc(Int32, Int32, Nil) | Nil)
on_resize=,
output : IO
output,
output=(output : IO)
output=,
poll_event(timeout_ms : Int32 = 0) : KeyEvent | MouseEvent | ResizeEvent | Nil
poll_event,
raw_mode(&)
raw_mode,
read_event : KeyEvent | MouseEvent | ResizeEvent | Nil
read_event,
show_cursor : Nil
show_cursor,
size : Tuple(Int32, Int32)
size,
write(str : String) : Nil
write
Constructor methods inherited from class Opal::Terminal::Driver
new(output : IO = STDOUT, input : IO = STDIN)
new
Constructor Detail
Instance Method Detail
Injects a keyboard or mouse event into the driver's input stream
Convenience helper: injects a keyboard event
Convenience helper: injects a mouse event
Non-blocking or timed check for input/resize events.
Reads the next simulated or injected input event
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.