gyscos / gyscos/cursive

[BUG] Blt backend could not resolve "ctrl-f" in the text_area example.

Open
#557 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

**Describe the bug**
Blt backend could not resolve "ctrl-f" in the text_area example.

**To Reproduce**
``
cursive\examples> cargo run --features cursive/blt-backend --no-default-features --bin text_area
``
and press ctrl-f in the textarea

**Expected behavior**
The search dialog should op up.

**Environment**
* Operating system used
Windows 10
* Backend used: ncurses (the default one), pancurses, crossterm, ...
blt

Temporarily I solved it this way
```diff
Index: cursive/src/backends/blt.rs
===================================================================
diff --git a/cursive/src/backends/blt.rs b/cursive/src/backends/blt.rs
--- a/cursive/src/backends/blt.rs (revision 8e252e176bb7b9b4bb1a37b3cdb957d5b92af490)
+++ b/cursive/src/backends/blt.rs (date 1613718816371)
@@ -374,7 +374,11 @@
}

fn blt_keycode_to_char(kc: KeyCode, shift: bool) -> char {
- match bear_lib_terminal::terminal::state::char() {
+ let c = bear_lib_terminal::terminal::state::char();
+ if (c as usize) < 32 /*code for space*/ {
+ return blt_keycode_to_char_impl(kc, shift);
+ }
+ match c {
'\u{0}' => blt_keycode_to_char_impl(kc, shift),
c => c,
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.