1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 02:20:08 +00:00

Optimize the key usage experience

This commit is contained in:
Tw93
2025-11-15 12:28:34 +08:00
parent 9b6eee968e
commit 78f5341a68
7 changed files with 25 additions and 34 deletions

View File

@@ -27,21 +27,6 @@ _pm_parse_csv_to_array() {
done
}
# Non-blocking input drain (bash 3.2) - improved for mouse wheel
drain_pending_input() {
local _k drained=0
# Multiple passes to handle mouse wheel burst sequences
while IFS= read -r -s -n 1 -t 0.01 _k 2> /dev/null; do
((drained++))
[[ $drained -gt 1000 ]] && break
done
# Second pass with shorter timeout
while IFS= read -r -s -n 1 -t 0.001 _k 2> /dev/null; do
((drained++))
[[ $drained -gt 1500 ]] && break
done
}
# Main paginated multi-select menu function
paginated_multi_select() {
local title="$1"