├── .tokeignore
├── .github
├── CODEOWNERS
├── workflows
│ ├── nightly.yml
│ ├── release-plz.yml
│ └── ci.yml
└── dependabot.yml
├── crates
├── terminput
│ ├── README.md
│ ├── Cargo.toml
│ ├── LICENSE-MIT
│ ├── src
│ │ ├── parser
│ │ │ └── LICENSE
│ │ ├── mouse.rs
│ │ └── lib.rs
│ ├── tests
│ │ └── match_test.rs
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
├── terminput-termina
│ ├── src
│ │ └── lib.rs
│ ├── Cargo.toml
│ ├── README.md
│ ├── LICENSE-MIT
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
├── terminput-web-sys
│ ├── src
│ │ ├── lib.rs
│ │ └── mapping.rs
│ ├── README.md
│ ├── Cargo.toml
│ ├── LICENSE-MIT
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
├── terminput-termion
│ ├── src
│ │ └── lib.rs
│ ├── Cargo.toml
│ ├── README.md
│ ├── LICENSE-MIT
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
├── terminput-egui
│ ├── src
│ │ └── lib.rs
│ ├── Cargo.toml
│ ├── README.md
│ ├── LICENSE-MIT
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
├── terminput-termwiz
│ ├── src
│ │ └── lib.rs
│ ├── Cargo.toml
│ ├── README.md
│ ├── LICENSE-MIT
│ ├── CHANGELOG.md
│ └── LICENSE-APACHE
└── terminput-crossterm
│ ├── src
│ └── lib.rs
│ ├── README.md
│ ├── LICENSE-MIT
│ ├── Cargo.toml
│ └── CHANGELOG.md
├── .gitignore
├── typos.toml
├── .githooks
├── pre-commit
└── commit-msg
├── release-plz.toml
├── rust-toolchain.toml
├── codecov.yml
├── examples
├── web
│ ├── index.html
│ ├── README.md
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── Cargo.toml
└── examples
│ ├── termion.rs
│ ├── termwiz.rs
│ ├── crossterm.rs
│ ├── match_event.rs
│ └── termina.rs
├── rustfmt.toml
├── committed.toml
├── Cargo.toml
├── deny.toml
├── LICENSE-MIT
├── CONTRIBUTING.md
├── Makefile.toml
├── cliff.toml
├── README.md
└── LICENSE-APACHE
/.tokeignore:
--------------------------------------------------------------------------------
1 | examples
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @aschey
2 |
--------------------------------------------------------------------------------
/crates/terminput/README.md:
--------------------------------------------------------------------------------
1 | ../../README.md
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | Cargo.lock
3 | .vscode
4 | dist
5 |
--------------------------------------------------------------------------------
/typos.toml:
--------------------------------------------------------------------------------
1 | [default.extend-words]
2 | ratatui = "ratatui"
3 |
--------------------------------------------------------------------------------
/.githooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | cargo +nightly fmt --all --check
--------------------------------------------------------------------------------
/release-plz.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | changelog_config = "./cliff.toml"
3 | release_always = false
4 |
--------------------------------------------------------------------------------
/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "1.92.0"
3 | components = ["rustfmt", "clippy"]
4 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | project:
4 | default:
5 | target: 0%
6 | patch:
7 | default:
8 | target: 0%
--------------------------------------------------------------------------------
/examples/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/web/README.md:
--------------------------------------------------------------------------------
1 | # Web Example
2 |
3 | Run with [`trunk`](https://trunkrs.dev)
4 |
5 | ```sh
6 | rustup target add wasm32-unknown-unknown
7 | cargo install trunk
8 | trunk serve
9 | ```
10 |
--------------------------------------------------------------------------------
/crates/terminput-termina/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(feature = "termina_0_1")]
7 | mod mapping;
8 | #[cfg(feature = "termina_0_1")]
9 | pub use mapping::*;
10 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(feature = "web_sys_0_3")]
7 | mod mapping;
8 |
9 | #[cfg(feature = "web_sys_0_3")]
10 | pub use mapping::*;
11 |
--------------------------------------------------------------------------------
/crates/terminput-termion/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(all(not(windows), feature = "termion_4"))]
7 | mod mapping;
8 | #[cfg(all(not(windows), feature = "termion_4"))]
9 | pub use mapping::*;
10 |
--------------------------------------------------------------------------------
/crates/terminput-egui/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(any(feature = "egui_0_32", feature = "egui_0_33"))]
7 | mod mapping;
8 | #[cfg(any(feature = "egui_0_32", feature = "egui_0_33"))]
9 | pub use mapping::*;
10 |
--------------------------------------------------------------------------------
/crates/terminput-termwiz/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(any(feature = "termwiz_0_22", feature = "termwiz_0_23"))]
7 | mod mapping;
8 | #[cfg(any(feature = "termwiz_0_22", feature = "termwiz_0_23"))]
9 | pub use mapping::*;
10 |
--------------------------------------------------------------------------------
/crates/terminput-crossterm/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![deny(clippy::unwrap_used)]
2 | #![warn(missing_docs, missing_debug_implementations)]
3 | #![cfg_attr(docsrs, feature(doc_cfg))]
4 | #![doc = include_str!("../README.md")]
5 |
6 | #[cfg(any(feature = "crossterm_0_28", feature = "crossterm_0_29"))]
7 | mod mapping;
8 | #[cfg(any(feature = "crossterm_0_28", feature = "crossterm_0_29"))]
9 | pub use mapping::*;
10 |
--------------------------------------------------------------------------------
/examples/web/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "web"
3 | version = "0.1.0"
4 | edition = "2024"
5 | license.workspace = true
6 | publish = false
7 |
8 | [dependencies]
9 | console_error_panic_hook = "0.1.7"
10 | terminput = { path = "../../crates/terminput" }
11 | terminput-web-sys = { path = "../../crates/terminput-web-sys" }
12 | wasm-bindgen = "0.2.100"
13 | web-sys = { version = "0.3.77", features = [
14 | "Window",
15 | "Document",
16 | "HtmlElement",
17 | "Text",
18 | ] }
19 |
--------------------------------------------------------------------------------
/rustfmt.toml:
--------------------------------------------------------------------------------
1 | # configuration for https://rust-lang.github.io/rustfmt/
2 | newline_style = "Unix"
3 | use_field_init_shorthand = true
4 | unstable_features = true
5 | style_edition = "2024"
6 | comment_width = 100
7 | error_on_line_overflow = true
8 | error_on_unformatted = false
9 | format_code_in_doc_comments = true
10 | format_macro_bodies = true
11 | format_macro_matchers = true
12 | format_strings = true
13 | imports_granularity = "Module"
14 | group_imports = "StdExternalCrate"
15 | normalize_doc_attributes = true
16 | wrap_comments = true
17 |
--------------------------------------------------------------------------------
/.githooks/commit-msg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | if !(command -v committed >/dev/null 2>&1); then
4 | echo Attempting to run committed as part of the pre-commit hooks but it\'s not installed.
5 | echo Please install it by running the following command:
6 | echo
7 | echo " cargo install committed"
8 | echo
9 | echo If you don\'t want to run committed, you can run
10 | echo the following command instead of git commit:
11 | echo
12 | echo " git commit --no-verify"
13 | exit 1
14 | fi
15 |
16 | committed --commit-file "$1"
--------------------------------------------------------------------------------
/.github/workflows/nightly.yml:
--------------------------------------------------------------------------------
1 | name: "Build on nightly"
2 | permissions:
3 | contents: read
4 | on:
5 | # Allows you to run this workflow manually from the Actions tab
6 | workflow_dispatch:
7 | schedule:
8 | - cron: "0 0 * * *"
9 | jobs:
10 | build-nightly:
11 | name: "Build with Nightly"
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v6
15 | - name: Install Rust nightly
16 | uses: dtolnay/rust-toolchain@stable
17 | with:
18 | toolchain: nightly
19 | - name: build
20 | run: cargo +nightly build --all-features
21 |
--------------------------------------------------------------------------------
/committed.toml:
--------------------------------------------------------------------------------
1 | # configuration for https://github.com/crate-ci/committed
2 |
3 | # https://www.conventionalcommits.org
4 | style = "conventional"
5 | # we can be lenient with formatting since we're going to squash merge anyway
6 | merge_commit = true
7 | subject_capitalized = false
8 | imperative_subject = false
9 | subject_not_punctuated = false
10 | # disable line length
11 | line_length = 0
12 | # disable subject length
13 | subject_length = 0
14 | # default allowed_types [ "chore", "docs", "feat", "fix", "perf", "refactor", "style", "test" ]
15 | allowed_types = [
16 | "build",
17 | "chore",
18 | "ci",
19 | "docs",
20 | "feat",
21 | "fix",
22 | "perf",
23 | "refactor",
24 | "revert",
25 | "style",
26 | "test",
27 | ]
28 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = ["./crates/*", "examples", "examples/web"]
3 | resolver = "3"
4 |
5 | [workspace.package]
6 | edition = "2024"
7 | rust-version = "1.88"
8 | authors = ["Austin Schey "]
9 | license = "MIT OR Apache-2.0"
10 | repository = "https://github.com/aschey/terminput"
11 | homepage = "https://github.com/aschey/terminput"
12 | include = ["/src", "/examples", "/tests", "LICENSE-MIT", "LICENSE-APACHE"]
13 | categories = ["command-line-interface", "encoding"]
14 | keywords = ["tui", "terminal", "input", "ratatui"]
15 |
16 | [workspace.lints.rustdoc]
17 | broken_intra_doc_links = "deny"
18 |
19 | [workspace.lints.clippy]
20 | doc_markdown = "warn"
21 | default_trait_access = "warn"
22 | ignored_unit_patterns = "warn"
23 | semicolon_if_nothing_returned = "warn"
24 | missing_fields_in_debug = "warn"
25 | use_self = "warn"
26 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "cargo"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 | day: "saturday"
8 | commit-message:
9 | prefix: "chore(deps)"
10 | ignore:
11 | - dependency-name: "*"
12 | update-types: ["version-update:semver-patch"]
13 | # ignore minor updates for stable crates that have reached 1.0
14 | - dependency-name: "bitflags"
15 | update-types: ["version-update:semver-minor"]
16 | - package-ecosystem: "rust-toolchain"
17 | directory: "/"
18 | schedule:
19 | interval: "weekly"
20 | day: "friday"
21 | commit-message:
22 | prefix: "chore"
23 | - package-ecosystem: "github-actions"
24 | directory: "/"
25 | schedule:
26 | interval: "weekly"
27 | day: "saturday"
28 | commit-message:
29 | prefix: "chore"
30 |
--------------------------------------------------------------------------------
/crates/terminput-termina/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-termina"
3 | version = "0.1.5"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "termina adapter for terminput"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies]
17 | termina_0_1 = { package = "termina", version = "0.1", optional = true }
18 | terminput = { path = "../terminput", version = "0.5.12" }
19 |
20 | [features]
21 | termina_0_1 = ["dep:termina_0_1"]
22 | default = ["termina_0_1"]
23 |
24 | [lints]
25 | workspace = true
26 |
27 | [package.metadata.docs.rs]
28 | all-features = true
29 | rustdoc-args = ["--cfg", "docsrs"]
30 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
31 |
--------------------------------------------------------------------------------
/crates/terminput-termion/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-termion"
3 | version = "0.3.8"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "termion adapter for terminput"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [target.'cfg(not(windows))'.dependencies]
17 | termion_4 = { package = "termion", version = "4", optional = true }
18 | terminput = { path = "../terminput", version = "0.5.12" }
19 |
20 | [features]
21 | termion_4 = ["dep:termion_4"]
22 | default = ["termion_4"]
23 |
24 | [lints]
25 | workspace = true
26 |
27 | [package.metadata.docs.rs]
28 | all-features = true
29 | rustdoc-args = ["--cfg", "docsrs"]
30 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
31 |
--------------------------------------------------------------------------------
/deny.toml:
--------------------------------------------------------------------------------
1 | [licenses]
2 | version = 2
3 | allow = [
4 | "MIT",
5 | "Apache-2.0",
6 | "Unicode-DFS-2016",
7 | "Unicode-3.0",
8 | "ISC",
9 | "BSD-2-Clause",
10 | "BSD-3-Clause",
11 | "MPL-2.0",
12 | "OpenSSL",
13 | "WTFPL",
14 | ]
15 |
16 | [[licenses.clarify]]
17 | name = "ring"
18 | # SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses
19 | # https://spdx.org/licenses/OpenSSL.html
20 | # ISC - Both BoringSSL and ring use this for their new files
21 | # MIT - "Files in third_party/ have their own licenses, as described therein. The MIT
22 | # license, for third_party/fiat, which, unlike other third_party directories, is
23 | # compiled into non-test libraries, is included below."
24 | # OpenSSL - Obviously
25 | expression = "ISC AND MIT AND OpenSSL"
26 | license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
27 |
28 | [advisories]
29 | version = 2
30 | yanked = "deny"
31 |
32 | [bans]
33 | multiple-versions = "allow"
34 |
--------------------------------------------------------------------------------
/examples/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-examples"
3 | publish = false
4 | edition = "2024"
5 | license.workspace = true
6 |
7 | [dev-dependencies]
8 | terminput = { path = "../crates/terminput" }
9 | terminput-crossterm = { path = "../crates/terminput-crossterm" }
10 | terminput-termwiz = { path = "../crates/terminput-termwiz" }
11 | terminput-termina = { path = "../crates/terminput-termina" }
12 | crossterm = "0.29"
13 | termwiz = "0.23"
14 | termina = "0.1"
15 |
16 | [target.'cfg(not(windows))'.dev-dependencies]
17 | terminput-termion = { path = "../crates/terminput-termion" }
18 | termion = "4"
19 |
20 | [[example]]
21 | name = "crossterm"
22 | doc-scrape-examples = true
23 |
24 | [[example]]
25 | name = "termion"
26 | doc-scrape-examples = true
27 |
28 | [[example]]
29 | name = "termwiz"
30 | doc-scrape-examples = true
31 |
32 | [[example]]
33 | name = "termina"
34 | doc-scrape-examples = true
35 |
36 | [[example]]
37 | name = "match_event"
38 | doc-scrape-examples = true
39 |
--------------------------------------------------------------------------------
/crates/terminput/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput"
3 | version = "0.5.12"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "TUI input parser/encoder and abstraction over input backends"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies]
17 | bitflags = "2.9.4"
18 | serde = { version = "1.0.134", optional = true, features = ["derive"] }
19 |
20 | [dev-dependencies]
21 | crossterm = "0.29"
22 | terminput-crossterm = { path = "../terminput-crossterm" }
23 |
24 | [features]
25 | default = ["std"]
26 | serde = ["dep:serde", "bitflags/serde"]
27 | std = []
28 |
29 | [lints]
30 | workspace = true
31 |
32 | [package.metadata.docs.rs]
33 | all-features = true
34 | rustdoc-args = ["--cfg", "docsrs"]
35 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
36 |
--------------------------------------------------------------------------------
/crates/terminput-termwiz/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-termwiz"
3 | version = "0.4.8"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "termwiz adapter for terminput"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies]
17 | termwiz_0_23 = { package = "termwiz", version = "0.23", optional = true }
18 | termwiz_0_22 = { package = "termwiz", version = "0.22", optional = true }
19 | terminput = { path = "../terminput", version = "0.5.12" }
20 |
21 | [features]
22 | termwiz_0_23 = ["dep:termwiz_0_23"]
23 | termwiz_0_22 = ["dep:termwiz_0_22"]
24 | default = ["termwiz_0_23"]
25 |
26 | [lints]
27 | workspace = true
28 |
29 | [package.metadata.docs.rs]
30 | all-features = true
31 | rustdoc-args = ["--cfg", "docsrs"]
32 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
33 |
--------------------------------------------------------------------------------
/crates/terminput-egui/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-egui"
3 | version = "0.5.1"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "egui adapter for terminput"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies]
17 | egui_0_32 = { package = "egui", version = "0.32", default-features = false, optional = true }
18 | egui_0_33 = { package = "egui", version = "0.33", default-features = false, optional = true }
19 | terminput = { path = "../terminput", version = "0.5.12" }
20 |
21 | [features]
22 | egui_0_32 = ["dep:egui_0_32"]
23 | egui_0_33 = ["dep:egui_0_33"]
24 | default = ["egui_0_33"]
25 |
26 | [lints]
27 | workspace = true
28 |
29 | [package.metadata.docs.rs]
30 | all-features = true
31 | rustdoc-args = ["--cfg", "docsrs"]
32 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
33 |
--------------------------------------------------------------------------------
/crates/terminput-egui/README.md:
--------------------------------------------------------------------------------
1 | # terminput-egui
2 |
3 | [](https://crates.io/crates/terminput-egui)
4 | [](https://docs.rs/terminput-egui)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-egui` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`egui`](https://crates.io/crates/egui) types.
14 |
15 | ## Feature Flags
16 |
17 | - `egui_0_32` - uses `egui` 0.32 (default)
18 |
--------------------------------------------------------------------------------
/crates/terminput-termion/README.md:
--------------------------------------------------------------------------------
1 | # terminput-termion
2 |
3 | [](https://crates.io/crates/terminput-termion)
4 | [](https://docs.rs/terminput-termion)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-termion` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`termion`](https://crates.io/crates/termion) types.
14 |
15 | ## Feature Flags
16 |
17 | - `termion_4` - uses `termion` 4 (default)
18 |
--------------------------------------------------------------------------------
/crates/terminput-termina/README.md:
--------------------------------------------------------------------------------
1 | # terminput-termina
2 |
3 | [](https://crates.io/crates/terminput-termina)
4 | [](https://docs.rs/terminput-termina)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-termina` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`termina`](https://crates.io/crates/termina) types.
14 |
15 | ## Feature Flags
16 |
17 | - `termina_0_1` - uses `termina` 0.1 (default)
18 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/README.md:
--------------------------------------------------------------------------------
1 | # terminput-web-sys
2 |
3 | [](https://crates.io/crates/terminput-web-sys)
4 | [](https://docs.rs/terminput-web-sys)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-web-sys` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`web-sys`](https://crates.io/crates/web-sys) types.
14 |
15 | ## Feature Flags
16 |
17 | - `web_sys_0_3` - uses `web_sys` 0.3 (default)
18 |
--------------------------------------------------------------------------------
/crates/terminput-termwiz/README.md:
--------------------------------------------------------------------------------
1 | # terminput-termwiz
2 |
3 | [](https://crates.io/crates/terminput-termwiz)
4 | [](https://docs.rs/terminput-termwiz)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-termwiz` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`termwiz`](https://crates.io/crates/termwiz) types.
14 |
15 | ## Feature Flags
16 |
17 | - `termwiz_0_23` - uses `termwiz` 0.23 (default)
18 | - `termwiz_0_22` - uses `termwiz` 0.22
19 |
--------------------------------------------------------------------------------
/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-crossterm/README.md:
--------------------------------------------------------------------------------
1 | # terminput-crossterm
2 |
3 | [](https://crates.io/crates/terminput-crossterm)
4 | [](https://docs.rs/terminput-crossterm)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | `terminput-crossterm` provides helper functions for converting between
12 | [`terminput`](https://crates.io/crates/terminput) and
13 | [`crossterm`](https://crates.io/crates/crossterm) types.
14 |
15 | ## Feature Flags
16 |
17 | - `crossterm_0_29` - uses `crossterm` 0.29 (default)
18 | - `crossterm_0_28` - uses `crossterm` 0.28
19 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-web-sys"
3 | version = "0.2.8"
4 | description = "web-sys adapter for terminput"
5 | edition.workspace = true
6 | rust-version.workspace = true
7 | authors.workspace = true
8 | license.workspace = true
9 | repository.workspace = true
10 | homepage.workspace = true
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies.web_sys_0_3]
17 | version = "0.3.77"
18 | package = "web-sys"
19 | optional = true
20 | features = [
21 | "KeyboardEvent",
22 | "MouseEvent",
23 | "DragEvent",
24 | "ClipboardEvent",
25 | "WheelEvent",
26 | "DataTransfer",
27 | "Document",
28 | "Window",
29 | "Element",
30 | ]
31 |
32 | [dependencies]
33 | terminput = { path = "../terminput", version = "0.5.12" }
34 |
35 | [features]
36 | web_sys_0_3 = ["dep:web_sys_0_3"]
37 | default = ["web_sys_0_3"]
38 |
39 | [lints]
40 | workspace = true
41 |
42 | [package.metadata.docs.rs]
43 | all-features = true
44 | rustdoc-args = ["--cfg", "docsrs"]
45 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
46 |
--------------------------------------------------------------------------------
/crates/terminput/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-egui/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput/src/parser/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Timon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/crates/terminput-crossterm/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-termina/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-termion/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-termwiz/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-web-sys/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Austin Schey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/crates/terminput-crossterm/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "terminput-crossterm"
3 | version = "0.4.8"
4 | edition.workspace = true
5 | rust-version.workspace = true
6 | authors.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | homepage.workspace = true
10 | description = "crossterm adapter for terminput"
11 | include.workspace = true
12 | categories.workspace = true
13 | keywords.workspace = true
14 | readme = "./README.md"
15 |
16 | [dependencies.crossterm_0_28]
17 | version = "0.28"
18 | package = "crossterm"
19 | optional = true
20 | default-features = false
21 | features = ["events", "bracketed-paste", "windows"]
22 |
23 | [dependencies.crossterm_0_29]
24 | version = "0.29"
25 | package = "crossterm"
26 | optional = true
27 | default-features = false
28 | features = ["events", "bracketed-paste", "windows"]
29 |
30 | [dependencies]
31 | terminput = { path = "../terminput", version = "0.5.12" }
32 |
33 | [features]
34 | crossterm_0_28 = ["dep:crossterm_0_28"]
35 | crossterm_0_29 = ["dep:crossterm_0_29"]
36 | default = ["crossterm_0_29"]
37 |
38 | [lints]
39 | workspace = true
40 |
41 | [package.metadata.docs.rs]
42 | all-features = true
43 | rustdoc-args = ["--cfg", "docsrs"]
44 | cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
45 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribution guidelines
2 |
3 | Pull requests are welcome! If you wish to add a nontrivial feature, please
4 | create an issue first so we can discuss the implementation. If adding a new
5 | feature, please add test coverage as well.
6 |
7 | ## Git Hooks
8 |
9 | We provide git hooks to enforce some lint rules. If you have
10 | [cargo make](https://github.com/sagiegurari/cargo-make) installed, you can run
11 | `cargo make install-hooks`. If not, you can copy the hooks from `.githooks` to
12 | `.git/hooks`.
13 |
14 | ## Conventional commits
15 |
16 | We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
17 | for creating changelogs. These are checked using
18 | [committed](https://github.com/crate-ci/committed). If you install the git
19 | hooks, these are checked before commit.
20 |
21 | You don't have to use the conventional style for your commits if you don't want
22 | to, but please use it for your PR title. PRs are squash merged so the title will
23 | be the commit message going into `main`.
24 |
25 | ## Formatting
26 |
27 | We use some nightly-only features with rustfmt. If you're using rust analyzer,
28 | you can enable running `rustfmt` with nightly. See
29 | [here](https://github.com/rust-lang/rust-analyzer/issues/3627). If you're using
30 | the command line, you can run `cargo +nightly fmt`. If you install the git
31 | hooks, these are checked before commit.
32 |
--------------------------------------------------------------------------------
/examples/examples/termion.rs:
--------------------------------------------------------------------------------
1 | #[cfg(not(windows))]
2 | mod example {
3 |
4 | use std::io;
5 |
6 | use terminput::{Encoding, Event, KeyCode};
7 | use terminput_termion::to_terminput;
8 | use termion::input::TermRead;
9 |
10 | pub fn print_events() -> io::Result<()> {
11 | let stdin = io::stdin();
12 | let mut buf = [0; 16];
13 |
14 | for event in stdin.events() {
15 | let event: Result = to_terminput(event?);
16 |
17 | if let Ok(event) = event {
18 | println!("Event: {event:?}\r");
19 | let written = event.encode(&mut buf, Encoding::Xterm);
20 | if let Ok(written) = written {
21 | println!("Encoded: {:?}\r", &buf[..written]);
22 | if let Ok(Some(decoded)) = Event::parse_from(&buf[..written]) {
23 | println!("Decoded: {decoded:?}\r");
24 | }
25 | }
26 |
27 | if event == Event::Key(KeyCode::Esc.into()) {
28 | break;
29 | }
30 | }
31 | println!();
32 | }
33 | Ok(())
34 | }
35 | }
36 |
37 | #[cfg(not(windows))]
38 | fn main() -> std::io::Result<()> {
39 | use termion::input::MouseTerminal;
40 | use termion::raw::IntoRawMode;
41 |
42 | let stdout = std::io::stdout().into_raw_mode()?;
43 | let _stdout = MouseTerminal::from(stdout);
44 | example::print_events()?;
45 |
46 | Ok(())
47 | }
48 |
49 | #[cfg(windows)]
50 | fn main() {
51 | panic!("termion is not supported on windows");
52 | }
53 |
--------------------------------------------------------------------------------
/examples/examples/termwiz.rs:
--------------------------------------------------------------------------------
1 | use std::time::Duration;
2 |
3 | use terminput::{Encoding, Event, KeyCode};
4 | use terminput_termwiz::to_terminput;
5 | use termwiz::caps::Capabilities;
6 | use termwiz::terminal::buffered::BufferedTerminal;
7 | use termwiz::terminal::{SystemTerminal, Terminal};
8 |
9 | fn main() -> Result<(), Box> {
10 | let caps = Capabilities::new_from_env()?;
11 |
12 | let terminal = SystemTerminal::new(caps)?;
13 |
14 | let mut terminal = BufferedTerminal::new(terminal)?;
15 | terminal.terminal().set_raw_mode()?;
16 |
17 | print_events(terminal);
18 |
19 | Ok(())
20 | }
21 |
22 | fn print_events(mut terminal: BufferedTerminal) {
23 | let mut buf = [0; 16];
24 | loop {
25 | if let Ok(Some(event)) = terminal
26 | .terminal()
27 | .poll_input(Some(Duration::from_millis(10)))
28 | {
29 | let event: Result = to_terminput(event);
30 |
31 | if let Ok(event) = event {
32 | println!("Event: {event:?}\r");
33 | // Note: termwiz enables xterm's modifyOtherKeys setting which isn't supported by
34 | // the encoder
35 | let written = event.encode(&mut buf, Encoding::Xterm);
36 | if let Ok(written) = written {
37 | println!("Encoded: {:?}\r", &buf[..written]);
38 | if let Ok(Some(decoded)) = Event::parse_from(&buf[..written]) {
39 | println!("Decoded: {decoded:?}\r");
40 | }
41 | }
42 |
43 | if event == Event::Key(KeyCode::Esc.into()) {
44 | break;
45 | }
46 | }
47 | println!();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/.github/workflows/release-plz.yml:
--------------------------------------------------------------------------------
1 | name: Release-plz
2 |
3 | permissions:
4 | pull-requests: write
5 | contents: write
6 |
7 | on:
8 | push:
9 | branches:
10 | - main
11 |
12 | jobs:
13 |
14 | # Release unpublished packages.
15 | release-plz-release:
16 | name: Release-plz release
17 | runs-on: ubuntu-latest
18 | if: ${{ github.repository_owner == 'aschey' }}
19 | permissions:
20 | contents: write
21 | steps:
22 | - name: Checkout repository
23 | uses: actions/checkout@v6
24 | with:
25 | fetch-depth: 0
26 | - name: Install Rust toolchain
27 | uses: dtolnay/rust-toolchain@stable
28 | - name: Run release-plz
29 | uses: release-plz/action@v0.5
30 | with:
31 | command: release
32 | env:
33 | GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
34 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35 |
36 | # Create a PR with the new versions and changelog, preparing the next release.
37 | release-plz-pr:
38 | name: Release-plz PR
39 | runs-on: ubuntu-latest
40 | if: ${{ github.repository_owner == 'aschey' }}
41 | permissions:
42 | contents: write
43 | pull-requests: write
44 | concurrency:
45 | group: release-plz-${{ github.ref }}
46 | cancel-in-progress: false
47 | steps:
48 | - name: Checkout repository
49 | uses: actions/checkout@v6
50 | with:
51 | fetch-depth: 0
52 | - name: Install Rust toolchain
53 | uses: dtolnay/rust-toolchain@stable
54 | - name: Run release-plz
55 | uses: release-plz/action@v0.5
56 | with:
57 | command: release-pr
58 | env:
59 | GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
60 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
61 |
--------------------------------------------------------------------------------
/crates/terminput-termina/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.1.5](https://github.com/aschey/terminput/compare/terminput-termina-v0.1.4..terminput-termina-v0.1.5) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.1.4](https://github.com/aschey/terminput/compare/terminput-termina-v0.1.3..terminput-termina-v0.1.4) - 2025-10-10
13 |
14 | ### Miscellaneous Tasks
15 |
16 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
17 |
18 |
19 | ## [0.1.3](https://github.com/aschey/terminput/compare/terminput-termina-v0.1.2..terminput-termina-v0.1.3) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.1.2](https://github.com/aschey/terminput/compare/terminput-termina-v0.1.1..terminput-termina-v0.1.2) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.1.1](https://github.com/aschey/terminput/compare/terminput-termina-v0.1.0..terminput-termina-v0.1.1) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.1.0] - 2025-08-31
39 |
40 | ### Features
41 |
42 | - Termina adapter ([#64](https://github.com/aschey/terminput/issues/64)) - ([5ca8d69](https://github.com/aschey/terminput/commit/5ca8d69ededfa25bef8184dd4f9f11e5fc6fd248))
43 |
44 | ### Miscellaneous Tasks
45 |
46 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
47 |
48 |
--------------------------------------------------------------------------------
/Makefile.toml:
--------------------------------------------------------------------------------
1 | [config]
2 | default_to_workspace = false
3 |
4 | [tasks.install-hooks]
5 | script = '''
6 | echo "Installing git hooks..."
7 | cp .githooks/* .git/hooks
8 | '''
9 | script_runner = "@shell"
10 |
11 | [tasks.pre-coverage]
12 | install_crate = "cargo-nextest"
13 |
14 | [tasks.coverage]
15 | script = '''
16 | cargo llvm-cov test --all-features --lcov --ignore-filename-regex ".cargo|.*_test\.rs" > ./target/debug/lcov.info
17 | genhtml -o ./target/debug/coverage/ --show-details --ignore-errors source --legend ./target/debug/lcov.info
18 | '''
19 | clear = true
20 | install_crate = { binary = "cargo-llvm-cov", rustup_component_name = "llvm-tools-preview" }
21 | dependencies = ["pre-coverage"]
22 |
23 | [tasks.view-coverage]
24 | script = '''
25 | xdg-open ./target/debug/coverage/index.html
26 | '''
27 | dependencies = ["coverage"]
28 |
29 | [tasks.view-coverage.windows]
30 | script = '''
31 | ./target/debug/coverage/index.html
32 | '''
33 | dependencies = ["coverage"]
34 | script_runner = "@shell"
35 |
36 | [tasks.test]
37 | command = "cargo"
38 | args = ["test", "--all-features"]
39 | clear = true
40 | install_crate = "cargo-nextest"
41 |
42 | [tasks.test-docs]
43 | command = "cargo"
44 | args = ["test", "--doc", "--all-features"]
45 |
46 | [tasks.open-docs]
47 | env = { RUSTDOCFLAGS = "--cfg docsrs -D warnings" }
48 | toolchain = "nightly"
49 | command = "cargo"
50 | args = [
51 | "doc",
52 | "-Zunstable-options",
53 | "-Zrustdoc-scrape-examples",
54 | "--all-features",
55 | "--no-deps",
56 | "--open",
57 | ]
58 |
59 | [tasks.watch-docs]
60 | env = { RUSTDOCFLAGS = "--cfg docsrs -D warnings" }
61 | command = "watchexec"
62 | args = [
63 | "-r",
64 | "-e",
65 | "rs,md",
66 | "--",
67 | "cargo",
68 | "+nightly",
69 | "doc",
70 | "-Zunstable-options",
71 | "-Zrustdoc-scrape-examples",
72 | "--all-features",
73 | "--no-deps",
74 | ]
75 | install_crate = "watchexec-cli"
76 |
77 | [tasks.build-all]
78 | command = "cargo"
79 | args = ["build", "--all-features", "--examples"]
80 |
81 | [tasks.min-versions]
82 | command = "cargo"
83 | install_crate = "cargo-minimal-versions"
84 | args = ["minimal-versions", "check", "--all-features", "--direct"]
85 |
--------------------------------------------------------------------------------
/crates/terminput/tests/match_test.rs:
--------------------------------------------------------------------------------
1 | use terminput::KeyCode::*;
2 | use terminput::{
3 | ALT, CAPS_LOCK, CTRL, KeyEvent, KeyEventState, KeyModifiers, NUM_LOCK, key, modifiers, states,
4 | };
5 |
6 | #[test]
7 | fn test_match() {
8 | let key_event = KeyEvent::new(Char('c'));
9 | assert!(matches!(key_event, key!(Char('c'))));
10 | assert!(matches!(key_event, key!(KeyModifiers::NONE, Char('c'))));
11 | assert!(matches!(
12 | key_event,
13 | key!(KeyEventState::NONE, KeyModifiers::NONE, Char('c'))
14 | ));
15 | assert!(matches!(
16 | key_event,
17 | key!(KeyEventState::NONE, KeyModifiers::NONE, Char('c'))
18 | ));
19 | }
20 |
21 | #[test]
22 | fn test_match_with_state() {
23 | let key_event = KeyEvent::new(Char('c')).state(KeyEventState::CAPS_LOCK);
24 | assert!(matches!(key_event, key!(Char('c'))));
25 | assert!(matches!(key_event, key!(KeyModifiers::NONE, Char('c'))));
26 | assert!(matches!(
27 | key_event,
28 | key!(KeyEventState::CAPS_LOCK, KeyModifiers::NONE, Char('c'))
29 | ));
30 | }
31 |
32 | #[test]
33 | fn test_match_with_modifiers() {
34 | let key_event = KeyEvent::new(Char('c')).modifiers(CTRL);
35 | assert!(!matches!(key_event, key!(Char('c'))));
36 | assert!(matches!(key_event, key!(CTRL, Char('c'))));
37 | assert!(matches!(key_event, key!(CTRL | ALT, Char('c'))));
38 | assert!(matches!(
39 | key_event,
40 | key!(KeyEventState::NONE, CTRL, Char('c'))
41 | ));
42 | }
43 |
44 | #[test]
45 | fn test_match_with_compound_modifiers() {
46 | let key_event = KeyEvent::new(Char('c')).modifiers(CTRL | ALT);
47 | const CTRL_ALT: KeyModifiers = modifiers!(CTRL, ALT);
48 | assert!(!matches!(key_event, key!(Char('c'))));
49 | assert!(!matches!(key_event, key!(CTRL, Char('c'))));
50 | assert!(matches!(key_event, key!(CTRL_ALT, Char('c'))));
51 | assert!(matches!(
52 | key_event,
53 | key!(KeyEventState::NONE, CTRL_ALT, Char('c'))
54 | ));
55 | }
56 |
57 | #[test]
58 | fn test_match_with_compound_state() {
59 | let key_event = KeyEvent::new(Char('c')).state(CAPS_LOCK | NUM_LOCK);
60 | const CAPS_NUM_LOCK: KeyEventState = states!(CAPS_LOCK, NUM_LOCK);
61 | assert!(matches!(key_event, key!(Char('c'))));
62 | assert!(matches!(
63 | key_event,
64 | key!(CAPS_NUM_LOCK, KeyModifiers::NONE, Char('c'))
65 | ));
66 | }
67 |
--------------------------------------------------------------------------------
/examples/examples/crossterm.rs:
--------------------------------------------------------------------------------
1 | use std::io;
2 |
3 | use crossterm::event::{
4 | DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
5 | EnableFocusChange, EnableMouseCapture, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags,
6 | PushKeyboardEnhancementFlags, read,
7 | };
8 | use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
9 | use crossterm::{execute, queue};
10 | use terminput::{Encoding, Event, KeyCode, KittyFlags};
11 | use terminput_crossterm::to_terminput;
12 |
13 | fn print_events(encoding: Encoding) -> io::Result<()> {
14 | let mut buf = [0; 16];
15 | loop {
16 | let event: Result = to_terminput(read()?);
17 |
18 | if let Ok(event) = event {
19 | println!("Event: {event:?}\r");
20 | let written = event.encode(&mut buf, encoding);
21 | if let Ok(written) = written {
22 | println!("Encoded: {:?}\r", &buf[..written]);
23 | if let Ok(Some(decoded)) = Event::parse_from(&buf[..written]) {
24 | println!("Decoded: {decoded:?}\r");
25 | }
26 | }
27 |
28 | if event == Event::Key(KeyCode::Esc.into()) {
29 | break;
30 | }
31 | }
32 | println!();
33 | }
34 |
35 | Ok(())
36 | }
37 |
38 | fn main() -> io::Result<()> {
39 | println!("Press escape to exit");
40 |
41 | enable_raw_mode()?;
42 |
43 | let mut stdout = io::stdout();
44 |
45 | let supports_keyboard_enhancement = matches!(
46 | crossterm::terminal::supports_keyboard_enhancement(),
47 | Ok(true)
48 | );
49 |
50 | if supports_keyboard_enhancement {
51 | queue!(
52 | stdout,
53 | PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::all())
54 | )?;
55 | }
56 |
57 | execute!(
58 | stdout,
59 | EnableBracketedPaste,
60 | EnableFocusChange,
61 | EnableMouseCapture,
62 | )?;
63 |
64 | print_events(if supports_keyboard_enhancement {
65 | Encoding::Kitty(KittyFlags::all())
66 | } else {
67 | Encoding::Xterm
68 | })?;
69 |
70 | if supports_keyboard_enhancement {
71 | queue!(stdout, PopKeyboardEnhancementFlags)?;
72 | }
73 |
74 | execute!(
75 | stdout,
76 | DisableBracketedPaste,
77 | DisableFocusChange,
78 | DisableMouseCapture
79 | )?;
80 |
81 | disable_raw_mode()
82 | }
83 |
--------------------------------------------------------------------------------
/examples/examples/match_event.rs:
--------------------------------------------------------------------------------
1 | use std::io;
2 |
3 | use crossterm::event::{
4 | DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
5 | EnableFocusChange, EnableMouseCapture, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags,
6 | PushKeyboardEnhancementFlags, read,
7 | };
8 | use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
9 | use crossterm::{execute, queue};
10 | use terminput::KeyCode::*;
11 | use terminput::{ALT, CAPS_LOCK, CTRL, Event, KeyModifiers, MouseButton, Repeats, key, modifiers};
12 | use terminput_crossterm::to_terminput;
13 |
14 | fn print_events() -> io::Result<()> {
15 | const CTRL_ALT: KeyModifiers = modifiers!(CTRL, ALT);
16 |
17 | loop {
18 | let event: Result = to_terminput(read()?);
19 |
20 | let Ok(event) = event else {
21 | continue;
22 | };
23 |
24 | if let Some(key_event) = event.as_key_press(Repeats::Include) {
25 | match key_event {
26 | key!(CTRL | ALT, Char('c')) => {
27 | println!("'ctrl+c' or 'alt+c' pressed\r");
28 | }
29 | key!(CTRL_ALT, Char('c')) => {
30 | println!("'ctrl+alt+c' pressed\r");
31 | }
32 | // Note: this branch requires kitty keyboard protocol support
33 | key!(CAPS_LOCK, KeyModifiers::NONE, Char('c')) => {
34 | println!("'c' pressed with caps lock\r");
35 | }
36 | key!(Char('c')) => {
37 | println!("'c' pressed\r");
38 | }
39 | key!(Esc) => {
40 | break;
41 | }
42 | e => {
43 | println!("{e:?}\r");
44 | }
45 | }
46 | } else if let Some((mouse_event, MouseButton::Left)) = event.as_mouse_down() {
47 | println!("left mouse down: {mouse_event:?}\r");
48 | }
49 | }
50 |
51 | Ok(())
52 | }
53 |
54 | fn main() -> io::Result<()> {
55 | println!("Press esc to exit");
56 |
57 | enable_raw_mode()?;
58 |
59 | let mut stdout = io::stdout();
60 |
61 | let supports_keyboard_enhancement = matches!(
62 | crossterm::terminal::supports_keyboard_enhancement(),
63 | Ok(true)
64 | );
65 |
66 | if supports_keyboard_enhancement {
67 | queue!(
68 | stdout,
69 | PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::all())
70 | )?;
71 | }
72 |
73 | execute!(
74 | stdout,
75 | EnableBracketedPaste,
76 | EnableFocusChange,
77 | EnableMouseCapture,
78 | )?;
79 |
80 | print_events()?;
81 |
82 | if supports_keyboard_enhancement {
83 | queue!(stdout, PopKeyboardEnhancementFlags)?;
84 | }
85 |
86 | execute!(
87 | stdout,
88 | DisableBracketedPaste,
89 | DisableFocusChange,
90 | DisableMouseCapture
91 | )?;
92 |
93 | disable_raw_mode()
94 | }
95 |
--------------------------------------------------------------------------------
/crates/terminput/src/mouse.rs:
--------------------------------------------------------------------------------
1 | use crate::{Event, KeyModifiers};
2 |
3 | /// A mouse event.
4 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
5 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6 | pub struct MouseEvent {
7 | /// The kind of mouse event that was caused.
8 | pub kind: MouseEventKind,
9 | /// The column that the event occurred on.
10 | pub column: u16,
11 | /// The row that the event occurred on.
12 | pub row: u16,
13 | /// The key modifiers active when the event occurred.
14 | pub modifiers: KeyModifiers,
15 | }
16 |
17 | /// Mouse scroll direction.
18 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
19 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
20 | pub enum ScrollDirection {
21 | /// Scrolled mouse wheel upwards (away from the user).
22 | Up,
23 | /// Scrolled mouse wheel downwards (towards the user).
24 | Down,
25 | /// Scrolled mouse wheel left (usually on a laptop touchpad).
26 | Left,
27 | /// Scrolled mouse wheel right (usually on a laptop touchpad).
28 | Right,
29 | }
30 |
31 | impl ScrollDirection {
32 | /// Convenience method for applying a change in the vertical or horizontal direction in response
33 | /// to a scroll event.
34 | pub fn delta(&self) -> ScrollDelta {
35 | match self {
36 | Self::Up => ScrollDelta { x: 0, y: 1 },
37 | Self::Down => ScrollDelta { x: 0, y: -1 },
38 | Self::Left => ScrollDelta { x: 1, y: 0 },
39 | Self::Right => ScrollDelta { x: -1, y: 0 },
40 | }
41 | }
42 | }
43 |
44 | /// Represents the change that should be applied to the content in response to a scroll event.
45 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
46 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
47 | pub struct ScrollDelta {
48 | /// Change in the x (horizontal) direction.
49 | pub x: i32,
50 | /// Change in the y (vertical) direction.
51 | pub y: i32,
52 | }
53 |
54 | /// The type of mouse event.
55 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
56 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
57 | pub enum MouseEventKind {
58 | /// Pressed mouse button. Contains the button that was pressed.
59 | Down(MouseButton),
60 | /// Released mouse button. Contains the button that was released.
61 | Up(MouseButton),
62 | /// Moved the mouse cursor while pressing the contained mouse button.
63 | Drag(MouseButton),
64 | /// Moved the mouse cursor while not pressing a mouse button.
65 | Moved,
66 | /// Scrolled mouse wheel downwards (towards the user).
67 | Scroll(ScrollDirection),
68 | }
69 |
70 | /// The mouse button used for this event.
71 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
72 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
73 | pub enum MouseButton {
74 | /// Left mouse button.
75 | Left,
76 | /// Right mouse button.
77 | Right,
78 | /// Middle mouse button.
79 | Middle,
80 | /// Mouse button could not be determined.
81 | Unknown,
82 | }
83 |
84 | impl From for Event {
85 | fn from(value: MouseEvent) -> Self {
86 | Self::Mouse(value)
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/examples/examples/termina.rs:
--------------------------------------------------------------------------------
1 | use std::io::{self, Write};
2 | use std::time::Duration;
3 |
4 | use termina::escape::csi::{self, Csi, KittyKeyboardFlags};
5 | use termina::{PlatformTerminal, Terminal};
6 | use terminput::{Encoding, Event, KeyCode, KittyFlags};
7 | use terminput_termina::to_terminput;
8 |
9 | macro_rules! decset {
10 | ($mode:ident) => {
11 | csi::Csi::Mode(csi::Mode::SetDecPrivateMode(csi::DecPrivateMode::Code(
12 | csi::DecPrivateModeCode::$mode,
13 | )))
14 | };
15 | }
16 | macro_rules! decreset {
17 | ($mode:ident) => {
18 | csi::Csi::Mode(csi::Mode::ResetDecPrivateMode(csi::DecPrivateMode::Code(
19 | csi::DecPrivateModeCode::$mode,
20 | )))
21 | };
22 | }
23 |
24 | fn print_events(terminal: &PlatformTerminal, encoding: Encoding) -> io::Result<()> {
25 | let mut buf = [0; 16];
26 | loop {
27 | let event: Result = to_terminput(terminal.read(|e| !e.is_escape())?);
28 |
29 | if let Ok(event) = event {
30 | println!("Event: {event:?}\r");
31 | let written = event.encode(&mut buf, encoding);
32 | if let Ok(written) = written {
33 | println!("Encoded: {:?}\r", &buf[..written]);
34 | if let Ok(Some(decoded)) = Event::parse_from(&buf[..written]) {
35 | println!("Decoded: {decoded:?}\r");
36 | }
37 | }
38 |
39 | if event == Event::Key(KeyCode::Esc.into()) {
40 | break;
41 | }
42 | }
43 | println!();
44 | }
45 |
46 | Ok(())
47 | }
48 |
49 | fn main() -> io::Result<()> {
50 | println!("Press escape to exit");
51 |
52 | let mut terminal = PlatformTerminal::new()?;
53 | terminal.enter_raw_mode()?;
54 |
55 | write!(
56 | terminal,
57 | "{}",
58 | // Kitty keyboard
59 | Csi::Keyboard(csi::Keyboard::QueryFlags),
60 | )?;
61 | terminal.flush()?;
62 | let supports_kitty_keyboard =
63 | if terminal.poll(termina::Event::is_escape, Some(Duration::from_millis(100)))? {
64 | matches!(
65 | terminal.read(termina::Event::is_escape)?,
66 | termina::Event::Csi(Csi::Keyboard(csi::Keyboard::ReportFlags(_)))
67 | )
68 | } else {
69 | false
70 | };
71 |
72 | write!(
73 | terminal,
74 | "{}{}{}{}{}{}{}{}",
75 | csi::Csi::Keyboard(csi::Keyboard::PushFlags(KittyKeyboardFlags::all())),
76 | decset!(FocusTracking),
77 | decset!(BracketedPaste),
78 | decset!(MouseTracking),
79 | decset!(ButtonEventMouse),
80 | decset!(AnyEventMouse),
81 | decset!(RXVTMouse),
82 | decset!(SGRMouse),
83 | )?;
84 | terminal.flush()?;
85 |
86 | print_events(
87 | &terminal,
88 | if supports_kitty_keyboard {
89 | Encoding::Kitty(KittyFlags::all())
90 | } else {
91 | Encoding::Xterm
92 | },
93 | )?;
94 |
95 | write!(
96 | terminal,
97 | "{}{}{}{}{}{}{}{}",
98 | csi::Csi::Keyboard(csi::Keyboard::PopFlags(1)),
99 | decreset!(FocusTracking),
100 | decreset!(BracketedPaste),
101 | decreset!(MouseTracking),
102 | decreset!(ButtonEventMouse),
103 | decreset!(AnyEventMouse),
104 | decreset!(RXVTMouse),
105 | decreset!(SGRMouse),
106 | )?;
107 |
108 | Ok(())
109 | }
110 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.2.8](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.7..terminput-web-sys-v0.2.8) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.2.7](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.6..terminput-web-sys-v0.2.7) - 2025-10-10
13 |
14 | ### Miscellaneous Tasks
15 |
16 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
17 |
18 |
19 | ## [0.2.6](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.5..terminput-web-sys-v0.2.6) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.2.5](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.4..terminput-web-sys-v0.2.5) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.2.4](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.3..terminput-web-sys-v0.2.4) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.2.3](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.2..terminput-web-sys-v0.2.3) - 2025-08-31
39 |
40 | ### Miscellaneous Tasks
41 |
42 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
43 |
44 | ## [0.2.2](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.1..terminput-web-sys-v0.2.2) - 2025-08-25
45 |
46 | ### Miscellaneous Tasks
47 |
48 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
49 |
50 | ## [0.2.1](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.2.0..terminput-web-sys-v0.2.1) - 2025-08-19
51 |
52 | ### Miscellaneous Tasks
53 |
54 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
55 |
56 | ## [0.2.0](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.1.2..terminput-web-sys-v0.2.0) - 2025-08-15
57 |
58 | ### Features
59 |
60 | - [**breaking**] Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
61 |
62 | ### Miscellaneous Tasks
63 |
64 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
65 |
66 | ## [0.1.2](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.1.1..terminput-web-sys-v0.1.2) - 2025-07-13
67 |
68 | ### Documentation
69 |
70 | - Fix event type in paste docs ([#52](https://github.com/aschey/terminput/issues/52)) - ([fbfda7c](https://github.com/aschey/terminput/commit/fbfda7cd5e762dd28f9cc5de40be638f755f09c5))
71 |
72 | ## [0.1.1](https://github.com/aschey/terminput/compare/terminput-web-sys-v0.1.0..terminput-web-sys-v0.1.1) - 2025-07-13
73 |
74 | ### Miscellaneous Tasks
75 |
76 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
77 |
78 | ## [0.1.0] - 2025-07-13
79 |
80 | ### Features
81 |
82 | - Add web-sys backend ([#47](https://github.com/aschey/terminput/issues/47)) - ([8d7d055](https://github.com/aschey/terminput/commit/8d7d055917424fecc5167b6d03cf6267c7d46830))
83 |
84 |
--------------------------------------------------------------------------------
/examples/web/src/main.rs:
--------------------------------------------------------------------------------
1 | use terminput::Event;
2 | use terminput_web_sys::{
3 | to_terminput_key, to_terminput_mouse, to_terminput_mouse_drag, to_terminput_mouse_scroll,
4 | to_terminput_paste, to_terminput_resize,
5 | };
6 | use wasm_bindgen::JsCast;
7 | use wasm_bindgen::prelude::Closure;
8 | use web_sys::{ClipboardEvent, Document, DragEvent, KeyboardEvent, MouseEvent, WheelEvent, window};
9 |
10 | fn main() {
11 | console_error_panic_hook::set_once();
12 |
13 | let window = window().unwrap();
14 | let document = window.document().unwrap();
15 | let body = document.body().unwrap();
16 |
17 | let on_mouse = Closure::::new({
18 | let document = document.clone();
19 | move |e| {
20 | let mouse_event = to_terminput_mouse(e);
21 | append_text(&document, &format!("{mouse_event:?}\n"));
22 | }
23 | });
24 | let mouse_ref = Some(on_mouse.as_ref().unchecked_ref());
25 | document.set_onmousedown(mouse_ref);
26 | document.set_onmouseup(mouse_ref);
27 |
28 | // disabling this because it spams the window, but it does work
29 | // document.set_onmousemove(mouse_ref);
30 |
31 | on_mouse.forget();
32 |
33 | let on_drag = Closure::::new({
34 | let document = document.clone();
35 | move |e| {
36 | let drag_event = to_terminput_mouse_drag(e);
37 | append_text(&document, &format!("{drag_event:?}\n"));
38 | }
39 | });
40 | // Note: this only fires if you're dragging a text node, not an empty space on the document
41 | body.set_ondragover(Some(on_drag.as_ref().unchecked_ref()));
42 | on_drag.forget();
43 |
44 | let on_key = Closure::::new({
45 | let document = document.clone();
46 | move |e| {
47 | let key_event = to_terminput_key(e);
48 | append_text(&document, &format!("{key_event:?}\n"));
49 | }
50 | });
51 | let key_ref = Some(on_key.as_ref().unchecked_ref());
52 | document.set_onkeydown(key_ref);
53 | document.set_onkeyup(key_ref);
54 | on_key.forget();
55 |
56 | let on_paste = Closure::::new({
57 | let document = document.clone();
58 | move |e| {
59 | let clipboard_event = to_terminput_paste(e);
60 | append_text(&document, &format!("{clipboard_event:?}\n"));
61 | }
62 | });
63 | document.set_onpaste(Some(on_paste.as_ref().unchecked_ref()));
64 | on_paste.forget();
65 |
66 | let on_wheel = Closure::::new({
67 | let document = document.clone();
68 | move |e| {
69 | let scroll_event = to_terminput_mouse_scroll(e);
70 | append_text(&document, &format!("{scroll_event:?}\n"));
71 | }
72 | });
73 | document.set_onwheel(Some(on_wheel.as_ref().unchecked_ref()));
74 | on_wheel.forget();
75 |
76 | let on_resize = Closure::::new({
77 | let window = window.clone();
78 | let document = document.clone();
79 | move || {
80 | let resize_event = to_terminput_resize(&window);
81 | append_text(&document, &format!("{resize_event:?}\n"));
82 | }
83 | });
84 | // Note that this only fires when set on the window object
85 | window.set_onresize(Some(on_resize.as_ref().unchecked_ref()));
86 | on_resize.forget();
87 |
88 | let on_focus = Closure::::new({
89 | let document = document.clone();
90 | move || {
91 | let focus = Event::FocusGained;
92 | append_text(&document, &format!("{focus:?}\n"));
93 | }
94 | });
95 | window.set_onfocus(Some(on_focus.as_ref().unchecked_ref()));
96 | on_focus.forget();
97 |
98 | let on_blur = Closure::::new({
99 | let document = document.clone();
100 | move || {
101 | let focus = Event::FocusLost;
102 | append_text(&document, &format!("{focus:?}\n"));
103 | }
104 | });
105 | window.set_onblur(Some(on_blur.as_ref().unchecked_ref()));
106 | on_blur.forget();
107 | }
108 |
109 | fn append_text(document: &Document, text: &str) {
110 | let text_node = document.create_text_node(text);
111 | document.body().unwrap().append_child(&text_node).unwrap();
112 | }
113 |
--------------------------------------------------------------------------------
/cliff.toml:
--------------------------------------------------------------------------------
1 | # git-cliff ~ default configuration file
2 | # https://git-cliff.org/docs/configuration
3 | #
4 | # Lines starting with "#" are comments.
5 | # Configuration options are organized into tables and keys.
6 | # See documentation for more information on available options.
7 |
8 |
9 | [changelog]
10 | # changelog header
11 | header = """
12 | # Changelog\n
13 | All notable changes to this project will be documented in this file.\n
14 | """
15 | # template for the changelog body
16 | # https://keats.github.io/tera/docs/#introduction
17 | body = """
18 | {%- macro remote_url() -%}
19 | https://github.com/aschey/terminput
20 | {%- endmacro -%}
21 |
22 | {% macro print_commit(commit) -%}
23 | - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
24 | {% if commit.breaking %}[**breaking**] {% endif %}\
25 | {{ commit.message | upper_first }} - \
26 | ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
27 | {% endmacro -%}
28 |
29 | {% if version %}\
30 | {% if previous.version %}\
31 | ## [{{ version | trim_start_matches(pat="v") }}]\
32 | ({{ self::remote_url() }}/compare/{{ package }}-v{{ previous.version }}..{{package}}-v{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
33 | {% else %}\
34 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
35 | {% endif %}\
36 | {% else %}\
37 | ## [unreleased]
38 | {% endif %}\
39 |
40 | {% for group, commits in commits | group_by(attribute="group") %}
41 | ### {{ group | striptags | trim | upper_first }}
42 | {% for commit in commits
43 | | filter(attribute="scope")
44 | | sort(attribute="scope") %}
45 | {{ self::print_commit(commit=commit) }}
46 | {%- endfor %}
47 | {% for commit in commits %}
48 | {%- if not commit.scope -%}
49 | {{ self::print_commit(commit=commit) }}
50 | {% endif -%}
51 | {% endfor -%}
52 | {% endfor -%}
53 | {%- if github -%}
54 | {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
55 | ## New Contributors ❤️
56 | {% endif %}\
57 | {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
58 | * @{{ contributor.username }} made their first contribution
59 | {%- if contributor.pr_number %} in \
60 | [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
61 | {%- endif %}
62 | {%- endfor -%}
63 | {%- endif %}
64 |
65 | """
66 | # remove the leading and trailing whitespace from the template
67 | trim = true
68 |
69 | # postprocessors
70 | postprocessors = [
71 | { pattern = '', replace = "https://github.com/aschey/terminput" }, # replace repository URL
72 | ]
73 |
74 | [git]
75 | # parse the commits based on https://www.conventionalcommits.org
76 | conventional_commits = true
77 | # filter out the commits that are not conventional
78 | filter_unconventional = true
79 | # process each line of a commit as an individual commit
80 | split_commits = false
81 | # regex for preprocessing the commit messages
82 | commit_preprocessors = [
83 | { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))" },
84 | ]
85 | # regex for parsing and grouping commits
86 | commit_parsers = [
87 | { message = "^feat", group = "Features" },
88 | { message = "^fix", group = "Bug Fixes" },
89 | { message = "^doc", group = "Documentation" },
90 | { message = "^perf", group = "Performance" },
91 | { message = "^refactor", group = "Refactor" },
92 | { message = "^style", group = "Styling" },
93 | { message = "^test", group = "Testing" },
94 | { message = "^chore\\(deps\\)", group = "Dependencies" },
95 | { message = "^chore: release$", skip = true },
96 | { message = "^chore", group = "Miscellaneous Tasks" },
97 | { body = ".*security", group = "Security" },
98 | ]
99 | # protect breaking changes from being skipped due to matching a skipping commit_parser
100 | protect_breaking_commits = false
101 | # filter out the commits that are not matched by commit parsers
102 | filter_commits = false
103 | # glob pattern for matching git tags
104 | tag_pattern = "v[0-9]*"
105 | # regex for skipping tags
106 | # skip_tags = "v0.1.0-beta.1"
107 | # regex for ignoring tags
108 | ignore_tags = ""
109 | # sort the tags topologically
110 | topo_order = false
111 | # sort the commits inside sections by oldest/newest order
112 | sort_commits = "oldest"
113 | # limit the number of commits included in the changelog.
114 | # limit_commits = 42
115 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 | permissions:
3 | contents: read
4 | on:
5 | # Allows you to run this workflow manually from the Actions tab
6 | workflow_dispatch:
7 | push:
8 | branches:
9 | - main
10 | pull_request:
11 | branches:
12 | - main
13 | merge_group:
14 |
15 | env:
16 | RUST_MIN: "1.88"
17 |
18 | jobs:
19 | test:
20 | name: Run tests
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v6
24 | - name: Install Rust stable
25 | uses: dtolnay/rust-toolchain@stable
26 | with:
27 | toolchain: stable
28 | - uses: Swatinem/rust-cache@v2
29 | - name: Minimal build
30 | run: cargo build --no-default-features
31 | - name: Clippy
32 | run: |
33 | # Using "--examples" causes warnings in README files to be ignored for some reason
34 | # so we have to run this twice to include both README and example warnings
35 | cargo clippy --all-features -- -D warnings
36 | cargo clippy --all-features --examples -- -D warnings
37 | - name: Build all
38 | run: cargo build --all-features --examples
39 | - name: Install cargo-llvm-cov
40 | uses: taiki-e/install-action@cargo-llvm-cov
41 | - name: Test
42 | run: |
43 | cargo test --doc --all-features
44 | cargo llvm-cov test --all-features --codecov --ignore-filename-regex ".cargo|.*_test\.rs" > ./codecov.json
45 | - name: Upload coverage to Codecov
46 | uses: codecov/codecov-action@v5
47 | env:
48 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
49 | with:
50 | verbose: true
51 | fail_ci_if_error: true
52 | files: ./codecov.json
53 | check-backend-versions:
54 | strategy:
55 | matrix:
56 | feature:
57 | [
58 | crossterm_0_28,
59 | crossterm_0_29,
60 | egui_0_32,
61 | egui_0_33,
62 | termion_4,
63 | termwiz_0_22,
64 | termwiz_0_23,
65 | web_sys_0_3,
66 | termina_0_1,
67 | ]
68 | runs-on: ubuntu-latest
69 | steps:
70 | - uses: actions/checkout@v6
71 | - name: Install Rust stable
72 | uses: dtolnay/rust-toolchain@stable
73 | with:
74 | toolchain: stable
75 | - name: Build
76 | run: cargo build --no-default-features --features=${{ matrix.feature }}
77 |
78 | release-build:
79 | runs-on: ubuntu-latest
80 | steps:
81 | - uses: actions/checkout@v6
82 | - name: Install Rust stable
83 | uses: dtolnay/rust-toolchain@stable
84 | with:
85 | toolchain: stable
86 | - uses: Swatinem/rust-cache@v2
87 | - name: Build all
88 | run: |
89 | cargo build --release --all-features --examples
90 | cd examples/web
91 | cargo build --release
92 |
93 | min-versions:
94 | name: Check min dependency versions
95 | runs-on: ubuntu-latest
96 | steps:
97 | - uses: actions/checkout@v6
98 | - name: Install Rust nightly
99 | uses: dtolnay/rust-toolchain@stable
100 | with:
101 | toolchain: nightly
102 | - uses: Swatinem/rust-cache@v2
103 | - name: Install cargo-hack
104 | uses: taiki-e/install-action@cargo-hack
105 | - name: Install cargo-minimal-versions
106 | uses: taiki-e/install-action@cargo-minimal-versions
107 | - name: Cargo minimal-versions
108 | run: cargo minimal-versions check --all-features --direct
109 |
110 | min-rust:
111 | name: Check MSRV
112 | runs-on: ubuntu-latest
113 | steps:
114 | - uses: actions/checkout@v6
115 | # this interferes with the rust version that gets used
116 | - name: remove toolchain
117 | run: rm rust-toolchain.toml
118 | - name: Install Rust ${{ env.RUST_MIN }}
119 | uses: dtolnay/rust-toolchain@stable
120 | with:
121 | toolchain: ${{ env.RUST_MIN }}
122 | - uses: Swatinem/rust-cache@v2
123 | - name: Cargo check
124 | run: cargo check --all-features
125 |
126 | lint:
127 | name: "Lint"
128 | runs-on: ubuntu-latest
129 | steps:
130 | - uses: actions/checkout@v6
131 | - name: Install Rust nightly
132 | uses: dtolnay/rust-toolchain@stable
133 | with:
134 | toolchain: nightly
135 | components: rustfmt
136 | - name: Check typos
137 | uses: crate-ci/typos@master
138 | - name: rustfmt
139 | run: cargo +nightly fmt --all --check
140 | - name: Verify docs
141 | run: cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples --no-deps --all-features
142 | env:
143 | RUSTDOCFLAGS: --cfg docsrs -D warnings
144 | - name: Lint dependencies
145 | uses: EmbarkStudios/cargo-deny-action@v2
146 | # disabling until https://github.com/rustsec/audit-check/issues/28 is fixed
147 | # - name: Security vulnerabilities audit
148 | # uses: rustsec/audit-check@v2
149 | # with:
150 | # token: ${{ secrets.GITHUB_TOKEN }}
151 |
--------------------------------------------------------------------------------
/crates/terminput-termion/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.3.8](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.7..terminput-termion-v0.3.8) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.3.7](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.6..terminput-termion-v0.3.7) - 2025-10-10
13 |
14 | ### Miscellaneous Tasks
15 |
16 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
17 |
18 |
19 | ## [0.3.6](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.5..terminput-termion-v0.3.6) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.3.5](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.4..terminput-termion-v0.3.5) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.3.4](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.3..terminput-termion-v0.3.4) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.3.3](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.2..terminput-termion-v0.3.3) - 2025-08-31
39 |
40 | ### Miscellaneous Tasks
41 |
42 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
43 |
44 | ## [0.3.2](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.1..terminput-termion-v0.3.2) - 2025-08-25
45 |
46 | ### Miscellaneous Tasks
47 |
48 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
49 |
50 | ## [0.3.1](https://github.com/aschey/terminput/compare/terminput-termion-v0.3.0..terminput-termion-v0.3.1) - 2025-08-19
51 |
52 | ### Miscellaneous Tasks
53 |
54 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
55 |
56 | ## [0.3.0](https://github.com/aschey/terminput/compare/terminput-termion-v0.2.3..terminput-termion-v0.3.0) - 2025-08-15
57 |
58 | ### Features
59 |
60 | - [**breaking**] Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
61 |
62 | ### Miscellaneous Tasks
63 |
64 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
65 |
66 | ## [0.2.3](https://github.com/aschey/terminput/compare/terminput-termion-v0.2.2..terminput-termion-v0.2.3) - 2025-07-13
67 |
68 | ### Miscellaneous Tasks
69 |
70 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
71 |
72 | ## [0.2.2](https://github.com/aschey/terminput/compare/terminput-termion-v0.2.1..terminput-termion-v0.2.2) - 2025-07-13
73 |
74 | ### Miscellaneous Tasks
75 |
76 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
77 |
78 | ## [0.2.1](https://github.com/aschey/terminput/compare/terminput-termion-v0.2.0..terminput-termion-v0.2.1) - 2025-07-01
79 |
80 | ### Miscellaneous Tasks
81 |
82 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
83 |
84 | ## [0.2.0](https://github.com/aschey/terminput/compare/terminput-termion-v0.1.4..terminput-termion-v0.2.0) - 2025-05-16
85 |
86 | ### Miscellaneous Tasks
87 |
88 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
89 |
90 | ## [0.1.4](https://github.com/aschey/terminput/compare/terminput-termion-v0.1.3..terminput-termion-v0.1.4) - 2025-05-04
91 |
92 | ### Features
93 |
94 | - Expose conversion methods for key and mouse events ([#37](https://github.com/aschey/terminput/issues/37)) - ([44f612b](https://github.com/aschey/terminput/commit/44f612bd825563894bae5d9b2a6bd4a1165b43a7))
95 |
96 | ## [0.1.3](https://github.com/aschey/terminput/compare/terminput-termion-v0.1.2..terminput-termion-v0.1.3) - 2025-04-05
97 |
98 | ### Documentation
99 |
100 | - Add missing doc_auto_cfg ([#36](https://github.com/aschey/terminput/issues/36)) - ([04d6748](https://github.com/aschey/terminput/commit/04d67484b85b73e58b16e9c8ebbb40b53b2a17c3))
101 |
102 | ## [0.1.2](https://github.com/aschey/terminput/compare/terminput-termion-v0.1.1..terminput-termion-v0.1.2) - 2025-03-25
103 |
104 | ### Bug Fixes
105 |
106 | - Windows build issues ([#28](https://github.com/aschey/terminput/issues/28)) -([2e571f2](https://github.com/aschey/terminput/commit/2e571f28e0409efb4d6a1d7ba2cc05cd7e8ec79e))
107 |
108 | ## [0.1.1](https://github.com/aschey/terminput/compare/terminput-termion-v0.1.0..terminput-termion-v0.1.1) - 2025-03-25
109 |
110 | ### Documentation
111 |
112 | - Use correct readme paths([#25](https://github.com/aschey/terminput/issues/25)) -([ac93b8a](https://github.com/aschey/terminput/commit/ac93b8ac5611af6642cee47be58ec528412a3653))
113 |
114 | ## [0.1.0] - 2025-03-25
115 |
116 | ### Refactor
117 |
118 | - [**breaking**] Break adapters into separate crates([#17](https://github.com/aschey/terminput/issues/17)) -([78d098c](https://github.com/aschey/terminput/commit/78d098cf9629a53cab25cd16a488351e95497f69))
119 |
--------------------------------------------------------------------------------
/crates/terminput-termwiz/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.4.8](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.7..terminput-termwiz-v0.4.8) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.4.7](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.6..terminput-termwiz-v0.4.7) - 2025-10-10
13 |
14 | ### Miscellaneous Tasks
15 |
16 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
17 |
18 |
19 | ## [0.4.6](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.5..terminput-termwiz-v0.4.6) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.4.5](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.4..terminput-termwiz-v0.4.5) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.4.4](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.3..terminput-termwiz-v0.4.4) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.4.3](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.2..terminput-termwiz-v0.4.3) - 2025-08-31
39 |
40 | ### Miscellaneous Tasks
41 |
42 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
43 |
44 | ## [0.4.2](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.1..terminput-termwiz-v0.4.2) - 2025-08-25
45 |
46 | ### Miscellaneous Tasks
47 |
48 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
49 |
50 | ## [0.4.1](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.4.0..terminput-termwiz-v0.4.1) - 2025-08-19
51 |
52 | ### Miscellaneous Tasks
53 |
54 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
55 |
56 | ## [0.4.0](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.3.3..terminput-termwiz-v0.4.0) - 2025-08-15
57 |
58 | ### Features
59 |
60 | - [**breaking**] Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
61 |
62 | ### Miscellaneous Tasks
63 |
64 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
65 |
66 | ## [0.3.3](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.3.2..terminput-termwiz-v0.3.3) - 2025-07-13
67 |
68 | ### Miscellaneous Tasks
69 |
70 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
71 |
72 | ## [0.3.2](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.3.1..terminput-termwiz-v0.3.2) - 2025-07-13
73 |
74 | ### Miscellaneous Tasks
75 |
76 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
77 |
78 | ## [0.3.1](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.3.0..terminput-termwiz-v0.3.1) - 2025-07-01
79 |
80 | ### Miscellaneous Tasks
81 |
82 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
83 |
84 | ## [0.3.0](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.2.3..terminput-termwiz-v0.3.0) - 2025-05-16
85 |
86 | ### Miscellaneous Tasks
87 |
88 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
89 |
90 | ## [0.2.3](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.2.2..terminput-termwiz-v0.2.3) - 2025-05-04
91 |
92 | ### Features
93 |
94 | - Expose conversion methods for key and mouse events ([#37](https://github.com/aschey/terminput/issues/37)) - ([44f612b](https://github.com/aschey/terminput/commit/44f612bd825563894bae5d9b2a6bd4a1165b43a7))
95 |
96 | ## [0.2.2](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.2.1..terminput-termwiz-v0.2.2) - 2025-04-05
97 |
98 | ### Documentation
99 |
100 | - Add missing doc_auto_cfg ([#36](https://github.com/aschey/terminput/issues/36)) - ([04d6748](https://github.com/aschey/terminput/commit/04d67484b85b73e58b16e9c8ebbb40b53b2a17c3))
101 |
102 | ## [0.2.1](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.2.0..terminput-crossterm-v0.2.1) - 2025-03-25
103 |
104 | ### Documentation
105 |
106 | - Use correct readme paths([#25](https://github.com/aschey/terminput/issues/25)) -([ac93b8a](https://github.com/aschey/terminput/commit/ac93b8ac5611af6642cee47be58ec528412a3653))
107 |
108 | ## [0.2.0](https://github.com/aschey/terminput/compare/terminput-termwiz-v0.1.0..terminput-termwiz-v0.2.0) - 2025-03-25
109 |
110 | ### Dependencies
111 |
112 | - _(deps)_ [**breaking**] Update termwiz requirement from 0.22 to 0.23([#22](https://github.com/aschey/terminput/issues/22)) -([6b4e691](https://github.com/aschey/terminput/commit/6b4e6916a261bd853605f8cc534e4083c1ab142e))
113 |
114 | ## [0.1.0] - 2025-03-25
115 |
116 | ### Refactor
117 |
118 | - [**breaking**] Break adapters into separate crates([#17](https://github.com/aschey/terminput/issues/17)) -([78d098c](https://github.com/aschey/terminput/commit/78d098cf9629a53cab25cd16a488351e95497f69))
119 |
--------------------------------------------------------------------------------
/crates/terminput-egui/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.5.1](https://github.com/aschey/terminput/compare/terminput-egui-v0.5.0..terminput-egui-v0.5.1) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.5.0](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.6..terminput-egui-v0.5.0) - 2025-10-10
13 |
14 | ### Dependencies
15 |
16 | - *(deps)* Egui 0.33 support ([#79](https://github.com/aschey/terminput/issues/79)) - ([3b8d700](https://github.com/aschey/terminput/commit/3b8d700d8a371ae45001dee79d6f23764b790c83))
17 |
18 |
19 | ## [0.4.6](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.5..terminput-egui-v0.4.6) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.4.5](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.4..terminput-egui-v0.4.5) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.4.4](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.3..terminput-egui-v0.4.4) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.4.3](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.2..terminput-egui-v0.4.3) - 2025-08-31
39 |
40 | ### Features
41 |
42 | - Termina adapter ([#64](https://github.com/aschey/terminput/issues/64)) - ([5ca8d69](https://github.com/aschey/terminput/commit/5ca8d69ededfa25bef8184dd4f9f11e5fc6fd248))
43 |
44 | ### Miscellaneous Tasks
45 |
46 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
47 |
48 | ## [0.4.2](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.1..terminput-egui-v0.4.2) - 2025-08-25
49 |
50 | ### Miscellaneous Tasks
51 |
52 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
53 |
54 | ## [0.4.1](https://github.com/aschey/terminput/compare/terminput-egui-v0.4.0..terminput-egui-v0.4.1) - 2025-08-19
55 |
56 | ### Miscellaneous Tasks
57 |
58 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
59 |
60 | ## [0.4.0](https://github.com/aschey/terminput/compare/terminput-egui-v0.3.2..terminput-egui-v0.4.0) - 2025-08-15
61 |
62 | ### Features
63 |
64 | - [**breaking**] Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
65 |
66 | ### Miscellaneous Tasks
67 |
68 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
69 |
70 | ## [0.3.2](https://github.com/aschey/terminput/compare/terminput-egui-v0.3.1..terminput-egui-v0.3.2) - 2025-07-13
71 |
72 | ### Miscellaneous Tasks
73 |
74 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
75 |
76 | ## [0.3.1](https://github.com/aschey/terminput/compare/terminput-egui-v0.3.0..terminput-egui-v0.3.1) - 2025-07-13
77 |
78 | ### Miscellaneous Tasks
79 |
80 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
81 |
82 | ## [0.3.0](https://github.com/aschey/terminput/compare/terminput-egui-v0.2.1..terminput-egui-v0.3.0) - 2025-07-12
83 |
84 | ### Dependencies
85 |
86 | - *(deps)* [**breaking**] Update egui requirement from 0.31 to 0.32 ([#45](https://github.com/aschey/terminput/issues/45)) - ([77f070f](https://github.com/aschey/terminput/commit/77f070fb52342a25c48a59509dec4534cab3446e))
87 |
88 | ## [0.2.1](https://github.com/aschey/terminput/compare/terminput-egui-v0.2.0..terminput-egui-v0.2.1) - 2025-07-01
89 |
90 | ### Miscellaneous Tasks
91 |
92 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
93 |
94 | ## [0.2.0](https://github.com/aschey/terminput/compare/terminput-egui-v0.1.3..terminput-egui-v0.2.0) - 2025-05-16
95 |
96 | ### Miscellaneous Tasks
97 |
98 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
99 |
100 | ## [0.1.3](https://github.com/aschey/terminput/compare/terminput-egui-v0.1.2..terminput-egui-v0.1.3) - 2025-05-04
101 |
102 | ### Features
103 |
104 | - Expose conversion methods for key and mouse events ([#37](https://github.com/aschey/terminput/issues/37)) - ([44f612b](https://github.com/aschey/terminput/commit/44f612bd825563894bae5d9b2a6bd4a1165b43a7))
105 |
106 | ## [0.1.2](https://github.com/aschey/terminput/compare/terminput-egui-v0.1.1..terminput-egui-v0.1.2) - 2025-04-05
107 |
108 | ### Documentation
109 |
110 | - Add missing doc_auto_cfg ([#36](https://github.com/aschey/terminput/issues/36)) - ([04d6748](https://github.com/aschey/terminput/commit/04d67484b85b73e58b16e9c8ebbb40b53b2a17c3))
111 |
112 | ## [0.1.1](https://github.com/aschey/terminput/compare/terminput-egui-v0.1.0..terminput-egui-v0.1.1) - 2025-03-25
113 |
114 | ### Documentation
115 |
116 | - Use correct readme paths([#25](https://github.com/aschey/terminput/issues/25)) -([ac93b8a](https://github.com/aschey/terminput/commit/ac93b8ac5611af6642cee47be58ec528412a3653))
117 |
118 | ## [0.1.0] - 2025-03-25
119 |
120 | ### Refactor
121 |
122 | - [**breaking**] Break adapters into separate crates([#17](https://github.com/aschey/terminput/issues/17)) -([78d098c](https://github.com/aschey/terminput/commit/78d098cf9629a53cab25cd16a488351e95497f69))
123 |
--------------------------------------------------------------------------------
/crates/terminput-crossterm/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.4.8](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.7..terminput-crossterm-v0.4.8) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.4.7](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.6..terminput-crossterm-v0.4.7) - 2025-10-10
13 |
14 | ### Miscellaneous Tasks
15 |
16 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
17 |
18 |
19 | ## [0.4.6](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.5..terminput-crossterm-v0.4.6) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.4.5](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.4..terminput-crossterm-v0.4.5) - 2025-09-03
27 |
28 | ### Miscellaneous Tasks
29 |
30 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
31 |
32 | ## [0.4.4](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.3..terminput-crossterm-v0.4.4) - 2025-08-31
33 |
34 | ### Miscellaneous Tasks
35 |
36 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
37 |
38 | ## [0.4.3](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.2..terminput-crossterm-v0.4.3) - 2025-08-31
39 |
40 | ### Miscellaneous Tasks
41 |
42 | - Remove dependency status ([#66](https://github.com/aschey/terminput/issues/66)) - ([0326a5a](https://github.com/aschey/terminput/commit/0326a5a0c0249a07ec226bfcbb007c00b43db489))
43 |
44 | ### Refactor
45 |
46 | - Map key event state explicitly ([#67](https://github.com/aschey/terminput/issues/67)) - ([5acc427](https://github.com/aschey/terminput/commit/5acc4272d525af83e195c3ced396eeb0ee35c24f))
47 |
48 | ## [0.4.2](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.1..terminput-crossterm-v0.4.2) - 2025-08-25
49 |
50 | ### Miscellaneous Tasks
51 |
52 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
53 |
54 | ## [0.4.1](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.4.0..terminput-crossterm-v0.4.1) - 2025-08-19
55 |
56 | ### Miscellaneous Tasks
57 |
58 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
59 |
60 | ## [0.4.0](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.3.3..terminput-crossterm-v0.4.0) - 2025-08-15
61 |
62 | ### Features
63 |
64 | - [**breaking**] Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
65 |
66 | ### Miscellaneous Tasks
67 |
68 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
69 |
70 | ## [0.3.3](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.3.2..terminput-crossterm-v0.3.3) - 2025-07-13
71 |
72 | ### Miscellaneous Tasks
73 |
74 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
75 |
76 | ## [0.3.2](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.3.1..terminput-crossterm-v0.3.2) - 2025-07-13
77 |
78 | ### Miscellaneous Tasks
79 |
80 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
81 |
82 | ## [0.3.1](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.3.0..terminput-crossterm-v0.3.1) - 2025-07-01
83 |
84 | ### Miscellaneous Tasks
85 |
86 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
87 |
88 | ## [0.3.0](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.2.1..terminput-crossterm-v0.3.0) - 2025-05-16
89 |
90 | ### Miscellaneous Tasks
91 |
92 | - Updated the following local packages: terminput - ([0000000](https://github.com/aschey/terminput/commit/0000000))
93 |
94 | ## [0.2.1](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.2.0..terminput-crossterm-v0.2.1) - 2025-05-04
95 |
96 | ### Features
97 |
98 | - Expose conversion methods for key and mouse events ([#37](https://github.com/aschey/terminput/issues/37)) - ([44f612b](https://github.com/aschey/terminput/commit/44f612bd825563894bae5d9b2a6bd4a1165b43a7))
99 |
100 | ## [0.2.0](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.1.2..terminput-crossterm-v0.2.0) - 2025-04-05
101 |
102 | ### Dependencies
103 |
104 | - *(deps)* [**breaking**] Update crossterm requirement from 0.28 to 0.29 ([#34](https://github.com/aschey/terminput/issues/34)) - ([db9c309](https://github.com/aschey/terminput/commit/db9c309b65c262d4bbe9e5f587344b85a01a3be6))
105 |
106 | ### Documentation
107 |
108 | - Add missing doc_auto_cfg ([#36](https://github.com/aschey/terminput/issues/36)) - ([04d6748](https://github.com/aschey/terminput/commit/04d67484b85b73e58b16e9c8ebbb40b53b2a17c3))
109 |
110 | ## [0.1.2](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.1.1..terminput-crossterm-v0.1.2) - 2025-03-25
111 |
112 | ### Bug Fixes
113 |
114 | - Windows build issues ([#28](https://github.com/aschey/terminput/issues/28)) -([2e571f2](https://github.com/aschey/terminput/commit/2e571f28e0409efb4d6a1d7ba2cc05cd7e8ec79e))
115 |
116 | ## [0.1.1](https://github.com/aschey/terminput/compare/terminput-crossterm-v0.1.0..terminput-crossterm-v0.1.1) - 2025-03-25
117 |
118 | ### Documentation
119 |
120 | - Use correct readme paths([#25](https://github.com/aschey/terminput/issues/25)) -([ac93b8a](https://github.com/aschey/terminput/commit/ac93b8ac5611af6642cee47be58ec528412a3653))
121 |
122 | ## [0.1.0] - 2025-03-25
123 |
124 | ### Refactor
125 |
126 | - [**breaking**] Break adapters into separate crates([#17](https://github.com/aschey/terminput/issues/17)) -([78d098c](https://github.com/aschey/terminput/commit/78d098cf9629a53cab25cd16a488351e95497f69))
127 |
--------------------------------------------------------------------------------
/crates/terminput/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [0.5.12](https://github.com/aschey/terminput/compare/terminput-v0.5.11..terminput-v0.5.12) - 2025-12-13
6 |
7 | ### Documentation
8 |
9 | - Fix clippy warning about backticks ([#82](https://github.com/aschey/terminput/issues/82)) - ([054c010](https://github.com/aschey/terminput/commit/054c0103ae761fd45d0c20f5228c237c2dd92acf))
10 |
11 |
12 | ## [0.5.11](https://github.com/aschey/terminput/compare/terminput-v0.5.10..terminput-v0.5.11) - 2025-10-10
13 |
14 | ### Dependencies
15 |
16 | - *(deps)* Egui 0.33 support ([#79](https://github.com/aschey/terminput/issues/79)) - ([3b8d700](https://github.com/aschey/terminput/commit/3b8d700d8a371ae45001dee79d6f23764b790c83))
17 |
18 |
19 | ## [0.5.10](https://github.com/aschey/terminput/compare/terminput-v0.5.9..terminput-v0.5.10) - 2025-10-03
20 |
21 | ### Miscellaneous Tasks
22 |
23 | - Remove doc_auto_cfg ([#75](https://github.com/aschey/terminput/issues/75)) - ([d41e741](https://github.com/aschey/terminput/commit/d41e7414f322dbc04550c9b6b4abdeeb4b0ac8ec))
24 |
25 |
26 | ## [0.5.9](https://github.com/aschey/terminput/compare/terminput-v0.5.8..terminput-v0.5.9) - 2025-09-03
27 |
28 | ### Bug Fixes
29 |
30 | - Prevent subtraction with overflow on invalid mouse coordinates ([#70](https://github.com/aschey/terminput/issues/70)) - ([9a10ac9](https://github.com/aschey/terminput/commit/9a10ac9cdec2ff87aacf08915503a58dd9c15c3f))
31 |
32 | ## [0.5.8](https://github.com/aschey/terminput/compare/terminput-v0.5.7..terminput-v0.5.8) - 2025-08-31
33 |
34 | ### Features
35 |
36 | - Implement conversions from mouse and key events ([#68](https://github.com/aschey/terminput/issues/68)) - ([3a90265](https://github.com/aschey/terminput/commit/3a90265f42a5535a6a176ead9b5d2c9dadb1c0ed))
37 |
38 | ## [0.5.7](https://github.com/aschey/terminput/compare/terminput-v0.5.6..terminput-v0.5.7) - 2025-08-31
39 |
40 | ### Features
41 |
42 | - Termina adapter ([#64](https://github.com/aschey/terminput/issues/64)) - ([5ca8d69](https://github.com/aschey/terminput/commit/5ca8d69ededfa25bef8184dd4f9f11e5fc6fd248))
43 |
44 | ## [0.5.6](https://github.com/aschey/terminput/compare/terminput-v0.5.5..terminput-v0.5.6) - 2025-08-25
45 |
46 | ### Miscellaneous Tasks
47 |
48 | - Update docs on use cases ([#62](https://github.com/aschey/terminput/issues/62)) - ([47d54c4](https://github.com/aschey/terminput/commit/47d54c40d3a315ad0dd42f475ac4b24d7d826328))
49 |
50 | ## [0.5.5](https://github.com/aschey/terminput/compare/terminput-v0.5.4..terminput-v0.5.5) - 2025-08-19
51 |
52 | ### Miscellaneous Tasks
53 |
54 | - Include license in build ([#59](https://github.com/aschey/terminput/issues/59)) - ([eb9fadc](https://github.com/aschey/terminput/commit/eb9fadc58bb9d8f1ddef2e1d44738257e9c519f0))
55 |
56 | ## [0.5.4](https://github.com/aschey/terminput/compare/terminput-v0.5.3..terminput-v0.5.4) - 2025-08-15
57 |
58 | ### Features
59 |
60 | - Support multiple backend versions ([#57](https://github.com/aschey/terminput/issues/57)) - ([42f49de](https://github.com/aschey/terminput/commit/42f49ded1cd86f91cbb9560c8036cea01a827ea9))
61 |
62 | ### Miscellaneous Tasks
63 |
64 | - Allow unwrap in tests ([#54](https://github.com/aschey/terminput/issues/54)) - ([409d335](https://github.com/aschey/terminput/commit/409d335c51af05f6fa53b7ac6b748d3e60df28ad))
65 |
66 | ## [0.5.3](https://github.com/aschey/terminput/compare/terminput-v0.5.2..terminput-v0.5.3) - 2025-07-13
67 |
68 | ### Miscellaneous Tasks
69 |
70 | - Fix readme typo ([#50](https://github.com/aschey/terminput/issues/50)) - ([ca6a995](https://github.com/aschey/terminput/commit/ca6a995821ec9b9461ba9d58d58574941f001e39))
71 |
72 | ## [0.5.2](https://github.com/aschey/terminput/compare/terminput-v0.5.1..terminput-v0.5.2) - 2025-07-13
73 |
74 | ### Features
75 |
76 | - Add web-sys backend ([#47](https://github.com/aschey/terminput/issues/47)) - ([8d7d055](https://github.com/aschey/terminput/commit/8d7d055917424fecc5167b6d03cf6267c7d46830))
77 |
78 | ## [0.5.1](https://github.com/aschey/terminput/compare/terminput-v0.5.0..terminput-v0.5.1) - 2025-07-01
79 |
80 | ### Documentation
81 |
82 | - Document feature flags ([#43](https://github.com/aschey/terminput/issues/43)) - ([a12a415](https://github.com/aschey/terminput/commit/a12a415f78156f400d197de68e8d6698348b5479))
83 |
84 | ### Terminput
85 |
86 | - Add support for `no_std` ([#41](https://github.com/aschey/terminput/issues/41)) - ([f309625](https://github.com/aschey/terminput/commit/f3096259526ceee8a42b4c5814b77e23725cf9a9))
87 |
88 | ## [0.5.0](https://github.com/aschey/terminput/compare/terminput-v0.4.3..terminput-v0.5.0) - 2025-05-16
89 |
90 | ### Miscellaneous Tasks
91 |
92 | - [**breaking**] Bump MSRV to 1.85 ([#39](https://github.com/aschey/terminput/issues/39)) - ([2cd9e18](https://github.com/aschey/terminput/commit/2cd9e1806223f4c288b6cd3ab5377c810465e5a4))
93 |
94 | ## [0.4.3](https://github.com/aschey/terminput/compare/terminput-v0.4.2..terminput-v0.4.3) - 2025-04-05
95 |
96 | ### Dependencies
97 |
98 | - *(deps)* Update crossterm requirement from 0.28 to 0.29 ([#34](https://github.com/aschey/terminput/issues/34)) - ([db9c309](https://github.com/aschey/terminput/commit/db9c309b65c262d4bbe9e5f587344b85a01a3be6))
99 |
100 | ## [0.4.2](https://github.com/aschey/terminput/compare/terminput-v0.4.1..terminput-v0.4.2) - 2025-03-25
101 |
102 | ### Documentation
103 |
104 | - Fix incorrect readme text ([#30](https://github.com/aschey/terminput/issues/30)) -([0fe1928](https://github.com/aschey/terminput/commit/0fe19285ca31dcf91d6b250361a4320f7c3ccaf8))
105 |
106 | ## [0.4.1](https://github.com/aschey/terminput/compare/terminput-v0.4.0..terminput-v0.4.1) - 2025-03-25
107 |
108 | ### Documentation
109 |
110 | - Use correct readme paths([#25](https://github.com/aschey/terminput/issues/25)) -([ac93b8a](https://github.com/aschey/terminput/commit/ac93b8ac5611af6642cee47be58ec528412a3653))
111 |
112 | ## [0.4.0](https://github.com/aschey/terminput/compare/v0.3.1..terminput-v0.4.0) - 2025-03-25
113 |
114 | ### Refactor
115 |
116 | - [**breaking**] Break adapters into separate crates([#17](https://github.com/aschey/terminput/issues/17)) -([78d098c](https://github.com/aschey/terminput/commit/78d098cf9629a53cab25cd16a488351e95497f69))
117 |
118 | ## [0.3.1](https://github.com/aschey/terminput/compare/v0.3.0..v0.3.1) - 2025-02-14
119 |
120 | ### Dependencies
121 |
122 | - _(deps)_ Support termwiz 0.22-0.23 (#14) -([71fe322](https://github.com/aschey/terminput/commit/71fe322093553d38daa1e94da1199320454d6bd8))
123 |
124 | ### Features
125 |
126 | - Add helpers for event matching (#13) -([b95512e](https://github.com/aschey/terminput/commit/b95512ebae0fb5fb0234a8120bf8031e52bcedc8))
127 |
128 | ## [0.3.0](https://github.com/aschey/terminput/compare/v0.2.2..v0.3.0) - 2025-02-08
129 |
130 | ### Dependencies
131 |
132 | - _(deps)_ [**breaking**] Update egui to 0.31 (#11) -([ce9441f](https://github.com/aschey/terminput/commit/ce9441fc893e1c627671c27ff9801d21e77518ea))
133 |
134 | ## [0.2.2](https://github.com/aschey/terminput/compare/v0.2.1..v0.2.2) - 2025-02-01
135 |
136 | ### Features
137 |
138 | - Serde support (#8) -([74a2927](https://github.com/aschey/terminput/commit/74a29279489db501322e1003a1aa2f6fc3cc4ef7))
139 |
140 | ## [0.2.1](https://github.com/aschey/terminput/compare/v0.2.0..v0.2.1) - 2025-01-22
141 |
142 | ### Documentation
143 |
144 | - Fix link typo (#6) -([f49e6f1](https://github.com/aschey/terminput/commit/f49e6f1904cabe52c4124e4d1b2821f40ba0dd80))
145 |
146 | ## [0.2.0](https://github.com/aschey/terminput/compare/v0.1.1..v0.2.0) - 2025-01-22
147 |
148 | ### Refactor
149 |
150 | - [**breaking**] Rename parse_event to Event::parse_from (#4) -([e02d9ab](https://github.com/aschey/terminput/commit/e02d9ab77aa82c487676ee5e76e65bd7c7cbd469))
151 |
152 | ## [0.1.1](https://github.com/aschey/terminput/compare/v0.1.0..v0.1.1) - 2025-01-22
153 |
154 | ### Documentation
155 |
156 | - Add docs.rs metadata config (#2) -([f1f0e95](https://github.com/aschey/terminput/commit/f1f0e957540eedc2fdab8d2ff7011497187dc540))
157 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # terminput
2 |
3 | [](https://crates.io/crates/terminput)
4 | [](https://docs.rs/terminput)
5 | 
6 | [](https://github.com/aschey/terminput/actions/workflows/ci.yml)
7 | [](https://codecov.io/gh/aschey/terminput)
8 | 
9 | 
10 |
11 | A library to abstract over various backends that provide input events, such as
12 | key presses and mouse clicks. This was mainly created as a common interface to
13 | the terminal backends that [Ratatui](https://crates.io/crates/ratatui) supports.
14 |
15 | Many TUI libraries with some kind of input handling mechanism want to support
16 | multiple backends, but mapping each backend's input structure into a common
17 | interface is tedious, and it can be difficult to keep up with all the new
18 | backends being added. This library aims to provide a uniform interface to these
19 | input types and prevent crates from having to manually add support for each
20 | backend.
21 |
22 | Additionally, we supply methods for parsing and encoding ANSI escape sequences
23 | for events.
24 |
25 | ## Feature Flags
26 |
27 | - `std` - Adds a dependency on the standard library, required for the encoder
28 | and parser modules (enabled by default).
29 | - `serde` - Adds serde serialization for event types (not enabled by default).
30 |
31 | ## Usage
32 |
33 | Use the conversion methods provided by the integration crates to convert to and
34 | from from `terminput`'s event types.
35 |
36 | ```rust,no_run
37 | use crossterm::event::read;
38 | use std::io;
39 | use terminput::Event;
40 | use terminput_crossterm::{to_crossterm, to_terminput};
41 |
42 | fn main() -> io::Result<()> {
43 | let crossterm_event = read()?;
44 | let event: Result = to_terminput(crossterm_event);
45 | println!("{event:?}");
46 |
47 | if let Ok(event) = event {
48 | // Conversions work both ways
49 | let event2: Result = to_crossterm(event);
50 | println!("{event2:?}");
51 | }
52 |
53 | Ok(())
54 | }
55 | ```
56 |
57 | ## Event Matching
58 |
59 | Some helpers for matching on events are included. See the
60 | [`match_event` example](https://github.com/aschey/terminput/blob/main/examples/examples/match_event.rs).
61 |
62 | ## Backends
63 |
64 | The following backends are currently supported via separate integration crates.
65 | Different versions of each backend can be used by activating a feature flag that
66 | matches the desired version. For example, crossterm 0.28 can be activated using
67 | the `crossterm_0_28` feature. The latest version of each backend will be enabled
68 | by default.
69 |
70 | See the docs for each integration crate for more details.
71 |
72 | | backend | integration crate | supported versions |
73 | | ------------------------------------------------- | --------------------------------------------------------------------- | ------------------ |
74 | | [`crossterm`](https://crates.io/crates/crossterm) | [`terminput-crossterm`](https://crates.io/crates/terminput-crossterm) | 0.28, 0.29 |
75 | | [`termion`](https://crates.io/crates/termion) | [`terminput-termion`](https://crates.io/crates/terminput-termion) | 4 |
76 | | [`termwiz`](https://crates.io/crates/termwiz) | [`terminput-termwiz`](https://crates.io/crates/terminput-termwiz) | 0.22, 0.23 |
77 | | [`termina`](https://crates.io/crates/termina) | [`terminput-termina`](https://crates.io/crates/terminput-termina) | 0.1 |
78 | | [`egui`](https://crates.io/crates/egui) | [`terminput-egui`](https://crates.io/crates/terminput-egui) | 0.32, 0.33 |
79 | | [`web-sys`](https://crates.io/crates/web-sys) | [`terminput-web-sys`](https://crates.io/crates/terminput-web-sys) | 0.3 |
80 |
81 | The [`Event`](https://docs.rs/terminput/latest/terminput/enum.Event.html) struct
82 | provided by this library is an attempt to create a superset of all supported
83 | backend functionality that TUI apps may be interested in.
84 |
85 | The following table shows the matrix of supported features:
86 |
87 | | feature | crossterm | termion | termwiz | termina | egui | web-sys |
88 | | ---------------------- | --------- | ------- | ------- | ------- | ---- | ------- |
89 | | **key press** | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
90 | | **key release/repeat** | ✓ | | | ✓ | ✓ | ✓ |
91 | | **mouse down** | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
92 | | **mouse up** | ✓ | ✓ | | ✓ | ✓ | ✓ |
93 | | **mouse move** | ✓ | | ✓ | ✓ | ✓ | ✓ |
94 | | **mouse drag** | ✓ | ✓ | | ✓ | | ✓ |
95 | | **focus** | ✓ | | | ✓ | ✓ | ✓ |
96 | | **paste** | ✓ | | ✓ | ✓ | ✓ | ✓ |
97 | | **resize** | ✓ | | ✓ | ✓ | | ✓ |
98 |
99 | Conversions for web-sys are only implemented in one direction (web-sys to
100 | terminput) because conversions in the other direction don't seem particularly
101 | useful. If you require this functionality, feel free to make a feature request.
102 |
103 | ## Parsing
104 |
105 | Use the
106 | [`Event::parse_from`](https://docs.rs/terminput/latest/terminput/enum.Event.html#method.parse_from)
107 | method to parse an ANSI-encoded sequence of bytes into an event struct. This can
108 | be helpful for usage with
109 | [SSH](https://docs.rs/russh/latest/russh/server/trait.Handler.html#method.data)
110 | or other situations where you need to read raw input from something other than a
111 | normal TTY device.
112 |
113 | The input parser used here was extracted from
114 | [crossterm's implementation](https://github.com/crossterm-rs/crossterm/blob/master/src/event/sys/unix/parse.rs).
115 |
116 | ```rust,no_run
117 | use terminput::Event;
118 |
119 | fn read_input(input: &[u8]) {
120 | let event = Event::parse_from(input);
121 |
122 | match event {
123 | Ok(Some(event)) => {
124 | println!("Successfully parsed input: {event:?}");
125 | }
126 | Ok(None) => {
127 | println!("More input required");
128 | }
129 | Err(e) => {
130 | println!("Unable to parse input: {e:?}");
131 | }
132 | }
133 | }
134 | ```
135 |
136 | ## Encoding
137 |
138 | `Input` structs can also be encoded into ANSI escape sequences using
139 | [`Event::encode`](https://docs.rs/terminput/latest/terminput/enum.Event.html#method.encode).
140 | This can be useful if you're
141 | [controlling a child pty](https://docs.rs/portable-pty/0.8.1/portable_pty/) and
142 | need to send it some encoded input.
143 |
144 | ```rust
145 | use terminput::{Encoding, Event, KeyCode, KeyEvent, KittyFlags};
146 |
147 | let event = Event::Key(KeyEvent::new(KeyCode::Char('a')));
148 | let mut buf = [0; 16];
149 |
150 | // Legacy encoding
151 | let written = event.encode(&mut buf, Encoding::Xterm);
152 | if let Ok(written) = written {
153 | println!("Encoded: {:?}", &buf[..written]);
154 | }
155 |
156 | // Kitty encoding
157 | let mut buf = [0; 16];
158 | let written = event.encode(&mut buf, Encoding::Kitty(KittyFlags::all()));
159 | if let Ok(written) = written {
160 | println!("Encoded: {:?}", &buf[..written]);
161 | }
162 | ```
163 |
164 | ## Supported Rust Versions
165 |
166 | The MSRV is currently `1.88.0`. Since Cargo's V3 resolver supports MSRV-aware
167 | dependencies, we do not treat an MSRV bump as a breaking change.
168 |
--------------------------------------------------------------------------------
/crates/terminput/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![no_std]
2 | #![deny(clippy::unwrap_used)]
3 | #![warn(missing_docs, missing_debug_implementations)]
4 | #![cfg_attr(docsrs, feature(doc_cfg))]
5 | #![doc = include_str!("../README.md")]
6 |
7 | extern crate alloc;
8 | #[cfg(feature = "std")]
9 | extern crate std;
10 |
11 | #[cfg(feature = "std")]
12 | mod encoder;
13 | mod key;
14 | mod mouse;
15 | #[cfg(feature = "std")]
16 | mod parser;
17 |
18 | use alloc::string::String;
19 | use core::error::Error;
20 | use core::fmt;
21 |
22 | #[cfg(feature = "std")]
23 | pub use encoder::*;
24 | pub use key::*;
25 | pub use mouse::*;
26 |
27 | /// The supplied event could not be converted into the requested type.
28 | #[derive(Debug)]
29 | pub struct UnsupportedEvent(pub String);
30 |
31 | impl fmt::Display for UnsupportedEvent {
32 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33 | write!(f, "Unsupported event: {}", self.0)
34 | }
35 | }
36 |
37 | impl Error for UnsupportedEvent {}
38 |
39 | /// An application event.
40 | #[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Hash)]
41 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
42 | pub enum Event {
43 | /// The application gained focus.
44 | FocusGained,
45 | /// The application lost focus.
46 | FocusLost,
47 | /// A keyboard input event.
48 | Key(KeyEvent),
49 | /// A mouse input event.
50 | Mouse(MouseEvent),
51 | /// A string that was pasted into the application.
52 | Paste(String),
53 | /// An resize event with new dimensions after resize.
54 | Resize {
55 | /// New number of rows.
56 | rows: u32,
57 | /// New number of columns.
58 | cols: u32,
59 | },
60 | }
61 |
62 | /// Whether to include [`KeyEventKind::Repeat`] when checking for key down events.
63 | #[derive(Debug, Clone, Copy, PartialEq, Eq)]
64 | pub enum Repeats {
65 | /// Include key repeat events.
66 | Include,
67 | /// Exclude key repeat events.
68 | Exclude,
69 | }
70 |
71 | impl Event {
72 | /// Returns the contained event if this is a [`KeyEvent`].
73 | pub fn as_key(&self) -> Option {
74 | if let Self::Key(key_event) = self {
75 | Some(*key_event)
76 | } else {
77 | None
78 | }
79 | }
80 |
81 | /// Returns whether the event is a [`KeyEvent`].
82 | pub fn is_key(&self) -> bool {
83 | self.as_key().is_some()
84 | }
85 |
86 | /// Returns the contained event if it is a key press event.
87 | ///
88 | /// If [`Repeats::Include`] is passed, both [`KeyEventKind::Press`] and [`KeyEventKind::Repeat`]
89 | /// are considered press events.
90 | ///
91 | /// If [`Repeats::Exclude`] is passed, only [`KeyEventKind::Press`] is considered.
92 | pub fn as_key_press(&self, repeats: Repeats) -> Option {
93 | if repeats == Repeats::Include {
94 | if let Self::Key(
95 | key_event @ KeyEvent {
96 | kind: KeyEventKind::Press | KeyEventKind::Repeat,
97 | ..
98 | },
99 | ) = self
100 | {
101 | Some(*key_event)
102 | } else {
103 | None
104 | }
105 | } else if let Self::Key(
106 | key_event @ KeyEvent {
107 | kind: KeyEventKind::Press,
108 | ..
109 | },
110 | ) = self
111 | {
112 | Some(*key_event)
113 | } else {
114 | None
115 | }
116 | }
117 |
118 | /// Returns whether the contained event is a key press event.
119 | ///
120 | /// If [`Repeats::Include`] is passed, both [`KeyEventKind::Press`] and [`KeyEventKind::Repeat`]
121 | /// are considered press events.
122 | ///
123 | /// If [`Repeats::Exclude`] is passed, only [`KeyEventKind::Press`] is considered.
124 | pub fn is_key_press(&self, repeats: Repeats) -> bool {
125 | self.as_key_press(repeats).is_some()
126 | }
127 |
128 | /// Returns the contained event if it is a [`KeyEventKind::Repeat`] key event.
129 | pub fn as_key_repeat(&self) -> Option {
130 | if let Self::Key(
131 | key_event @ KeyEvent {
132 | kind: KeyEventKind::Repeat,
133 | ..
134 | },
135 | ) = self
136 | {
137 | Some(*key_event)
138 | } else {
139 | None
140 | }
141 | }
142 |
143 | /// Returns whether the contained event is a [`KeyEventKind::Repeat`] key event.
144 | pub fn is_key_repeat(&self) -> bool {
145 | self.as_key_repeat().is_some()
146 | }
147 |
148 | /// Returns the contained event if it is a [`KeyEventKind::Release`] key event.
149 | pub fn as_key_release(&self) -> Option {
150 | if let Self::Key(
151 | key_event @ KeyEvent {
152 | kind: KeyEventKind::Release,
153 | ..
154 | },
155 | ) = self
156 | {
157 | Some(*key_event)
158 | } else {
159 | None
160 | }
161 | }
162 |
163 | /// Returns whether the contained event is a [`KeyEventKind::Release`] key event.
164 | pub fn is_key_release(&self) -> bool {
165 | self.as_key_release().is_some()
166 | }
167 |
168 | /// Returns the contained event if it is a [`MouseEvent`].
169 | pub fn as_mouse(&self) -> Option {
170 | if let Self::Mouse(mouse_event) = self {
171 | Some(*mouse_event)
172 | } else {
173 | None
174 | }
175 | }
176 |
177 | /// Returns whether the contained event is a [`MouseEvent`].
178 | pub fn is_mouse(&self) -> bool {
179 | self.as_mouse().is_some()
180 | }
181 |
182 | /// Returns the contained event if it is a [`MouseEventKind::Down`] mouse event.
183 | pub fn as_mouse_down(&self) -> Option<(MouseEvent, MouseButton)> {
184 | if let Self::Mouse(
185 | mouse_event @ MouseEvent {
186 | kind: MouseEventKind::Down(button),
187 | ..
188 | },
189 | ) = self
190 | {
191 | Some((*mouse_event, *button))
192 | } else {
193 | None
194 | }
195 | }
196 |
197 | /// Returns whether the event is a [`MouseEventKind::Down`] mouse event.
198 | pub fn is_mouse_down(&self) -> bool {
199 | self.as_mouse_down().is_some()
200 | }
201 |
202 | /// Returns the contained event if it is a [`MouseEventKind::Up`] mouse event.
203 | pub fn as_mouse_up(&self) -> Option<(MouseEvent, MouseButton)> {
204 | if let Self::Mouse(
205 | mouse_event @ MouseEvent {
206 | kind: MouseEventKind::Up(button),
207 | ..
208 | },
209 | ) = self
210 | {
211 | Some((*mouse_event, *button))
212 | } else {
213 | None
214 | }
215 | }
216 |
217 | /// Returns whether the event is a [`MouseEventKind::Up`] mouse event.
218 | pub fn is_mouse_up(&self) -> bool {
219 | self.as_mouse_up().is_some()
220 | }
221 |
222 | /// Returns the contained event if it is a [`MouseEventKind::Drag`] mouse event.
223 | pub fn as_mouse_drag(&self) -> Option<(MouseEvent, MouseButton)> {
224 | if let Self::Mouse(
225 | mouse_event @ MouseEvent {
226 | kind: MouseEventKind::Drag(button),
227 | ..
228 | },
229 | ) = self
230 | {
231 | Some((*mouse_event, *button))
232 | } else {
233 | None
234 | }
235 | }
236 |
237 | /// Returns whether the event is a [`MouseEventKind::Drag`] mouse event.
238 | pub fn is_mouse_drag(&self) -> bool {
239 | self.as_mouse_drag().is_some()
240 | }
241 |
242 | /// Returns the contained event if it is a [`MouseEventKind::Moved`] mouse event.
243 | pub fn as_mouse_move(&self) -> Option {
244 | if let Self::Mouse(
245 | mouse_event @ MouseEvent {
246 | kind: MouseEventKind::Moved,
247 | ..
248 | },
249 | ) = self
250 | {
251 | Some(*mouse_event)
252 | } else {
253 | None
254 | }
255 | }
256 |
257 | /// Returns whether the event is a [`MouseEventKind::Moved`] mouse event.
258 | pub fn is_mouse_move(&self) -> bool {
259 | self.as_mouse_move().is_some()
260 | }
261 |
262 | /// Returns the contained event if it is a [`MouseEventKind::Scroll`] mouse event.
263 | pub fn as_mouse_scroll(&self) -> Option<(MouseEvent, ScrollDirection)> {
264 | if let Self::Mouse(
265 | mouse_event @ MouseEvent {
266 | kind: MouseEventKind::Scroll(direction),
267 | ..
268 | },
269 | ) = self
270 | {
271 | Some((*mouse_event, *direction))
272 | } else {
273 | None
274 | }
275 | }
276 |
277 | /// Returns whether the event is a [`MouseEventKind::Scroll`] mouse event.
278 | pub fn is_mouse_scroll(&self) -> bool {
279 | self.as_mouse_scroll().is_some()
280 | }
281 |
282 | /// Returns whether the event is [`Event::FocusGained`].
283 | pub fn is_focus_gained(&self) -> bool {
284 | *self == Self::FocusGained
285 | }
286 |
287 | /// Returns whether the event is [`Event::FocusLost`].
288 | pub fn is_focus_lost(&self) -> bool {
289 | *self == Self::FocusLost
290 | }
291 |
292 | /// Returns the pasted text if the event is [`Event::Paste`].
293 | pub fn as_paste(&self) -> Option<&str> {
294 | if let Self::Paste(text) = self {
295 | Some(text)
296 | } else {
297 | None
298 | }
299 | }
300 |
301 | /// Returns whether the event is [`Event::Paste`].
302 | pub fn is_paste(&self) -> bool {
303 | self.as_paste().is_some()
304 | }
305 |
306 | /// Returns the `(rows, cols)` from the contained event if it is a [`Event::Resize`] event.
307 | pub fn as_resize(&self) -> Option<(u32, u32)> {
308 | if let Self::Resize { rows, cols } = self {
309 | Some((*rows, *cols))
310 | } else {
311 | None
312 | }
313 | }
314 |
315 | /// Returns whether the event is [`Event::Resize`].
316 | pub fn is_resize(&self) -> bool {
317 | self.as_resize().is_some()
318 | }
319 | }
320 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/src/mapping.rs:
--------------------------------------------------------------------------------
1 | use terminput::{
2 | Event, KeyCode, KeyEvent, KeyEventKind, KeyEventState, KeyModifiers, MediaKeyCode,
3 | ModifierDirection, ModifierKeyCode, MouseButton, MouseEvent, MouseEventKind, ScrollDirection,
4 | UnsupportedEvent,
5 | };
6 | use web_sys::wasm_bindgen::JsValue;
7 | #[cfg(feature = "web_sys_0_3")]
8 | use web_sys_0_3 as web_sys;
9 |
10 | /// Converts the [`web_sys`] [`MouseEvent`](web_sys::MouseEvent) to a terminput [`MouseEvent`].
11 | pub fn to_terminput_mouse(
12 | mouse_event: web_sys::MouseEvent,
13 | ) -> Result {
14 | let event_kind = mouse_event.type_();
15 | let mouse_button = to_terminput_mouse_button(mouse_event.button());
16 | Ok(MouseEvent {
17 | kind: to_terminput_mouse_kind(event_kind.as_str(), mouse_button)?,
18 | modifiers: to_terminput_mouse_modifiers(&mouse_event),
19 | column: mouse_event.client_x() as u16,
20 | row: mouse_event.client_y() as u16,
21 | })
22 | }
23 |
24 | /// Converts the [`web_sys`] [`DragEvent`](web_sys::DragEvent) to a terminput [`MouseEvent`].
25 | ///
26 | /// **NOTE:** this should be used with the `dragover` event to ensure the row/column values are
27 | /// populated.
28 | pub fn to_terminput_mouse_drag(drag_event: web_sys::DragEvent) -> MouseEvent {
29 | let mouse_button = to_terminput_mouse_button(drag_event.button());
30 |
31 | MouseEvent {
32 | kind: MouseEventKind::Drag(mouse_button),
33 | modifiers: to_terminput_drag_modifiers(&drag_event),
34 | column: drag_event.client_x() as u16,
35 | row: drag_event.client_y() as u16,
36 | }
37 | }
38 |
39 | /// Converts the [`web_sys`] [`WheelEvent`](`web_sys::WheelEvent`) to a terminput [`MouseEvent`].
40 | pub fn to_terminput_mouse_scroll(event: web_sys::WheelEvent) -> MouseEvent {
41 | let direction = to_terminput_scroll_direction(&event);
42 | MouseEvent {
43 | kind: MouseEventKind::Scroll(direction),
44 | modifiers: KeyModifiers::empty(),
45 | column: event.client_x() as u16,
46 | row: event.client_y() as u16,
47 | }
48 | }
49 |
50 | /// Converts the [`web_sys`] [`KeyboardEvent`](`web_sys::KeyboardEvent`) to a terminput
51 | /// [`KeyEvent`].
52 | pub fn to_terminput_key(key_event: web_sys::KeyboardEvent) -> Result {
53 | Ok(KeyEvent {
54 | code: to_terminput_key_code(
55 | &key_event.key(),
56 | to_terminput_modifier_direction(key_event.location()),
57 | )?,
58 | modifiers: to_terminput_key_modifiers(&key_event),
59 | state: key_state_to_terminput(&key_event),
60 | kind: to_terminput_key_kind(&key_event),
61 | })
62 | }
63 |
64 | /// Converts the [`web_sys`] [`ClipboardEvent`](`web_sys::ClipboardEvent`) to a terminput paste
65 | /// [`Event`].
66 | pub fn to_terminput_paste(
67 | clipboard_event: web_sys::ClipboardEvent,
68 | ) -> Result {
69 | if let Some(data) = clipboard_event.clipboard_data() {
70 | let content = data
71 | .get_data("text")
72 | .map_err(|e| map_js_error("failed to read clipboard data: ", e))?;
73 | Ok(Event::Paste(content))
74 | } else {
75 | Err(UnsupportedEvent("no clipboard data available".to_string()))
76 | }
77 | }
78 |
79 | /// Converts the [`web_sys`] window size to a terminput resize [`Event`].
80 | pub fn to_terminput_resize(window: &web_sys::Window) -> Result {
81 | let height = window
82 | .inner_height()
83 | .map_err(|e| map_js_error("failed to read height: ", e))?;
84 | let width = window
85 | .inner_width()
86 | .map_err(|e| map_js_error("failed to read width: ", e))?;
87 | let height = height.as_f64().unwrap_or_default();
88 | let width = width.as_f64().unwrap_or_default();
89 | Ok(Event::Resize {
90 | rows: height as u32,
91 | cols: width as u32,
92 | })
93 | }
94 |
95 | fn map_js_error(message: &str, error: JsValue) -> UnsupportedEvent {
96 | UnsupportedEvent(message.to_string() + &error.as_string().unwrap_or_default())
97 | }
98 |
99 | fn to_terminput_scroll_direction(event: &web_sys::WheelEvent) -> ScrollDirection {
100 | if event.delta_x() > 0.0 {
101 | ScrollDirection::Right
102 | } else if event.delta_x() < 0.0 {
103 | ScrollDirection::Left
104 | } else if event.delta_y() > 0.0 {
105 | ScrollDirection::Down
106 | } else {
107 | ScrollDirection::Up
108 | }
109 | }
110 |
111 | fn to_terminput_mouse_kind(
112 | event_kind: &str,
113 | mouse_button: MouseButton,
114 | ) -> Result {
115 | Ok(match event_kind {
116 | "mousemove" => MouseEventKind::Moved,
117 | "mousedown" => MouseEventKind::Down(mouse_button),
118 | "mouseup" => MouseEventKind::Up(mouse_button),
119 | kind => return Err(UnsupportedEvent(kind.to_string())),
120 | })
121 | }
122 |
123 | fn to_terminput_mouse_button(button: i16) -> MouseButton {
124 | match button {
125 | 0 => MouseButton::Left,
126 | 1 => MouseButton::Middle,
127 | 2 => MouseButton::Right,
128 | _ => MouseButton::Unknown,
129 | }
130 | }
131 |
132 | fn to_terminput_mouse_modifiers(event: &web_sys::MouseEvent) -> KeyModifiers {
133 | let mut modifiers = KeyModifiers::empty();
134 | if event.ctrl_key() {
135 | modifiers |= KeyModifiers::CTRL;
136 | }
137 | if event.shift_key() {
138 | modifiers |= KeyModifiers::SHIFT;
139 | }
140 | if event.alt_key() {
141 | modifiers |= KeyModifiers::ALT;
142 | }
143 | if event.meta_key() {
144 | modifiers |= KeyModifiers::META;
145 | }
146 |
147 | modifiers
148 | }
149 |
150 | fn to_terminput_drag_modifiers(event: &web_sys::DragEvent) -> KeyModifiers {
151 | let mut modifiers = KeyModifiers::empty();
152 | if event.ctrl_key() {
153 | modifiers |= KeyModifiers::CTRL;
154 | }
155 | if event.shift_key() {
156 | modifiers |= KeyModifiers::SHIFT;
157 | }
158 | if event.alt_key() {
159 | modifiers |= KeyModifiers::ALT;
160 | }
161 | if event.meta_key() {
162 | modifiers |= KeyModifiers::META;
163 | }
164 |
165 | modifiers
166 | }
167 |
168 | fn to_terminput_key_kind(key_event: &web_sys::KeyboardEvent) -> KeyEventKind {
169 | if key_event.repeat() {
170 | KeyEventKind::Repeat
171 | } else if key_event.type_() == "keyup" {
172 | KeyEventKind::Release
173 | } else {
174 | KeyEventKind::Press
175 | }
176 | }
177 |
178 | fn to_terminput_key_modifiers(event: &web_sys::KeyboardEvent) -> KeyModifiers {
179 | let mut modifiers = KeyModifiers::empty();
180 | if event.ctrl_key() {
181 | modifiers |= KeyModifiers::CTRL;
182 | }
183 | if event.shift_key() {
184 | modifiers |= KeyModifiers::SHIFT;
185 | }
186 | if event.alt_key() {
187 | modifiers |= KeyModifiers::ALT;
188 | }
189 | if event.meta_key() {
190 | modifiers |= KeyModifiers::META;
191 | }
192 |
193 | modifiers
194 | }
195 |
196 | fn to_terminput_modifier_direction(location: u32) -> ModifierDirection {
197 | match location {
198 | 1 => ModifierDirection::Left,
199 | 2 => ModifierDirection::Right,
200 | _ => ModifierDirection::Unknown,
201 | }
202 | }
203 |
204 | fn key_state_to_terminput(event: &web_sys::KeyboardEvent) -> KeyEventState {
205 | let mut state = KeyEventState::empty();
206 | if event.location() == 3 {
207 | state |= KeyEventState::KEYPAD;
208 | }
209 |
210 | if event.get_modifier_state("CapsLock") {
211 | state |= KeyEventState::CAPS_LOCK;
212 | }
213 | if event.get_modifier_state("NumLock") {
214 | state |= KeyEventState::NUM_LOCK;
215 | }
216 |
217 | state
218 | }
219 |
220 | fn to_terminput_key_code(
221 | key: &str,
222 | direction: ModifierDirection,
223 | ) -> Result {
224 | let key = key.to_ascii_lowercase();
225 | if key.len() == 1 {
226 | let key_char = key.chars().next().expect("length checked");
227 | if key_char.is_alphanumeric() {
228 | return Ok(KeyCode::Char(key_char));
229 | }
230 | }
231 | Ok(match key.as_str() {
232 | "f1" => KeyCode::F(1),
233 | "f2" => KeyCode::F(2),
234 | "f3" => KeyCode::F(3),
235 | "f4" => KeyCode::F(4),
236 | "f5" => KeyCode::F(5),
237 | "f6" => KeyCode::F(6),
238 | "f7" => KeyCode::F(7),
239 | "f8" => KeyCode::F(8),
240 | "f9" => KeyCode::F(9),
241 | "f10" => KeyCode::F(10),
242 | "f11" => KeyCode::F(11),
243 | "f12" => KeyCode::F(12),
244 | "backspace" => KeyCode::Backspace,
245 | "enter" => KeyCode::Enter,
246 | "arrowleft" => KeyCode::Left,
247 | "arrowright" => KeyCode::Right,
248 | "arrowup" => KeyCode::Up,
249 | "arrowdown" => KeyCode::Down,
250 | "tab" => KeyCode::Tab,
251 | "delete" => KeyCode::Delete,
252 | "home" => KeyCode::Home,
253 | "end" => KeyCode::End,
254 | "pageup" => KeyCode::PageUp,
255 | "pagedown" => KeyCode::PageDown,
256 | "capslock" => KeyCode::CapsLock,
257 | "scrolllock" => KeyCode::ScrollLock,
258 | "numlock" => KeyCode::NumLock,
259 | "printscreen" => KeyCode::PrintScreen,
260 | "alt" => KeyCode::Modifier(ModifierKeyCode::Alt, direction),
261 | "control" => KeyCode::Modifier(ModifierKeyCode::Control, direction),
262 | "hyper" => KeyCode::Modifier(ModifierKeyCode::Hyper, direction),
263 | "meta" => KeyCode::Modifier(ModifierKeyCode::Meta, direction),
264 | "super" => KeyCode::Modifier(ModifierKeyCode::Super, direction),
265 | "shift" => KeyCode::Modifier(ModifierKeyCode::Shift, direction),
266 | "mediaplay" => KeyCode::Media(MediaKeyCode::Play),
267 | "mediapause" => KeyCode::Media(MediaKeyCode::Pause),
268 | "mediaplaypause" => KeyCode::Media(MediaKeyCode::PlayPause),
269 | "mediastop" => KeyCode::Media(MediaKeyCode::Stop),
270 | "mediatracknext" => KeyCode::Media(MediaKeyCode::TrackNext),
271 | "mediatrackprevious" => KeyCode::Media(MediaKeyCode::TrackPrevious),
272 | "mediafastforward" => KeyCode::Media(MediaKeyCode::FastForward),
273 | "mediarewind" => KeyCode::Media(MediaKeyCode::Rewind),
274 | "mediarecord" => KeyCode::Media(MediaKeyCode::Record),
275 | key => return Err(UnsupportedEvent(key.to_string())),
276 | })
277 | }
278 |
--------------------------------------------------------------------------------
/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput-egui/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput-termina/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput-termion/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput-termwiz/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/crates/terminput-web-sys/LICENSE-APACHE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------