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

feature: search paste support #881

Merged
merged 7 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove keyboard event throttle
  • Loading branch information
ClementTsang committed Nov 10, 2022
commit 81636c9f101a1c72117227f290fbe25569c39e50
2 changes: 1 addition & 1 deletion docs/content/usage/widgets/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Lastly, we can refine our search even further based on the other columns, like P
<img src="../../../assets/screenshots/process/search/cpu.webp" alt="A picture of searching for a process with a search condition that uses the CPU keyword."/>
</figure>

You can also paste search queries (e.g. ++shift+insert++, ++ctrl+shift+v++), though this may not work in some Windows terminals.
You can also paste search queries (e.g. ++shift+insert++, ++ctrl+shift+v++).

#### Keywords

Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ pub fn create_input_thread(
) -> JoinHandle<()> {
thread::spawn(move || {
let mut mouse_timer = Instant::now();
let mut keyboard_timer = Instant::now();

loop {
if let Ok(is_terminated) = termination_ctrl_lock.try_lock() {
Expand All @@ -439,11 +438,8 @@ pub fn create_input_thread(
}
}
Event::Key(key) => {
if Instant::now().duration_since(keyboard_timer).as_millis() >= 20 {
if sender.send(BottomEvent::KeyInput(key)).is_err() {
break;
}
keyboard_timer = Instant::now();
if sender.send(BottomEvent::KeyInput(key)).is_err() {
break;
}
}
Event::Mouse(mouse) => {
Expand Down