Packages

🌈 Ink bindings for Gleam! ✨

Current section

Files

Jump to
glink src glink use_input.gleam
Raw

src/glink/use_input.gleam

import glink/internal
pub type Handler =
fn(String, Key) -> Nil
pub type Key {
/// Handy information about a key that was pressed.
Key(
/// Up arrow key was pressed.
up_arrow: Bool,
/// Down arrow key was pressed.
down_arrow: Bool,
/// Left arrow key was pressed.
left_arrow: Bool,
/// Right arrow key was pressed.
right_arrow: Bool,
/// Page Down key was pressed.
page_down: Bool,
/// Page Up key was pressed.
page_up: Bool,
/// Return (Enter) key was pressed.
return: Bool,
/// Escape key was pressed.
escape: Bool,
/// Ctrl key was pressed.
ctrl: Bool,
/// Shift key was pressed.
shift: Bool,
/// Tab key was pressed.
tab: Bool,
/// Backspace key was pressed.
backspace: Bool,
/// Delete key was pressed.
delete: Bool,
/// [Meta key](https://en.wikipedia.org/wiki/Meta_key) was pressed.
meta: Bool,
)
}
pub type Option
pub fn is_active(is_active: Bool) -> Option {
internal.to_prop("isActive", is_active)
}