Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert(clafrica): whitespaces as allowed chacracters #64

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Implement the auto capitalization. [(#56)](https://github.com/pythonbrad/clafrica/pull/56)

### Fixed
- Allowed whitespaces usage. [(#63)](https://github.com/pythonbrad/clafrica/pull/63)
- Improve the pause/resume way via double pressing of CTRL key. [(#54)](https://github.com/pythonbrad/clafrica/pull/54)
- Drop function key F1-12 which was reserved for special purposes. [(#62)](https://github.com/pythonbrad/clafrica/pull/62)

Expand Down
1 change: 0 additions & 1 deletion clafrica/data/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ cc = { value = "ç", alias = ["ccced"]}
uu = "ʉ"
uu3 = "ʉ̄"
uuaf3 = "ʉ̄ɑ̄"
"a\t" = "ɑ"
8 changes: 2 additions & 6 deletions clafrica/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ pub fn run(config: config::Config, mut frontend: impl Frontend) -> Result<(), io
for event in rx.iter() {
let character = event.name.and_then(|s| s.chars().next());
let is_valid = character
.map(|c| c.is_alphanumeric() || c.is_ascii_punctuation() || c.is_whitespace())
.unwrap_or(false);
.map(|c| c.is_alphanumeric() || c.is_ascii_punctuation())
.unwrap_or_default();

match event.event_type {
EventType::KeyPress(E_Key::Backspace) => {
Expand Down Expand Up @@ -257,10 +257,6 @@ mod tests {
input!(CapsLock Num5 CapsLock KeyU, typing_speed_ms);
output!(textfield, format!("{LIMIT}αÛû"));

// We verify that the usage of white works as expected
input!(KeyA Tab, typing_speed_ms);
output!(textfield, format!("{LIMIT}αÛûɑ"));

rstk::end_wish();
}
}
Loading