Skip to content

Commit

Permalink
Fix issue mattydebie#62 - race condition for modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
wwalker committed Sep 18, 2021
1 parent 62c95af commit 651fd95
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bwmenu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ITEMS=

# Stores which command will be used to emulate keyboard type
AUTOTYPE_MODE=
# Stores the argument need by xdotool to clear the modifiers (shift, control, alt, ...) first
CLEAR_MODIFIERS=

# Stores which command will be used to deal with clipboards
CLIPBOARD_MODE=
Expand Down Expand Up @@ -244,16 +246,17 @@ select_autotype_command() {
AUTOTYPE_MODE=(sudo ydotool)
elif [ "$XDG_SESSION_TYPE" != "wayland" ] && hash xdotool 2>/dev/null; then
AUTOTYPE_MODE=xdotool
CLEAR_MODIFIERS="--clearmodifiers"
fi
fi
}

type_word() {
"${AUTOTYPE_MODE[@]}" type "$1"
"${AUTOTYPE_MODE[@]}" type $CLEAR_MODIFIERS "$1"
}

type_tab() {
"${AUTOTYPE_MODE[@]}" key Tab
"${AUTOTYPE_MODE[@]}" key $CLEAR_MODIFIERS Tab
}


Expand Down

0 comments on commit 651fd95

Please sign in to comment.