ChordFor returns all of the key chord triggers for the given key function in the map, separating them with newlines.
(kf Functions)
| 179 | // ChordFor returns all of the key chord triggers for the given |
| 180 | // key function in the map, separating them with newlines. |
| 181 | func (km *Map) ChordFor(kf Functions) key.Chord { |
| 182 | res := []string{} |
| 183 | for key, fun := range *km { |
| 184 | if fun == kf { |
| 185 | res = append(res, string(key)) |
| 186 | } |
| 187 | } |
| 188 | slices.Sort(res) |
| 189 | return key.Chord(strings.Join(res, "\n")) |
| 190 | } |
| 191 | |
| 192 | // Chord returns all of the key chord triggers for this |
| 193 | // key function in the current active map, separating them with newlines. |