Skip to content
Open
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
11 changes: 10 additions & 1 deletion io/key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const (
NameF11 = "F11"
NameF12 = "F12"
NameBack = "Back"
NameDash = "Dash"
)

// Contain reports whether m contains all modifiers
Expand All @@ -238,7 +239,15 @@ func (k Set) Contains(name string, mods Modifiers) bool {
var modSet, keySet string
sep := strings.LastIndex(chord, "-")
if sep != -1 {
modSet, keySet = chord[:sep], chord[sep+1:]
if sep == len(chord)-1 {
if sep != 0 {
modSet, keySet = chord[:sep-1], "-"
} else {
modSet, keySet = "", "-"
}
} else {
modSet, keySet = chord[:sep], chord[sep+1:]
}
} else {
modSet, keySet = "", chord
}
Expand Down