MCPcopy Create free account
hub / github.com/cogentcore/core / ChordFor

Method ChordFor

keymap/keymap.go:181–190  ·  view source on GitHub ↗

ChordFor returns all of the key chord triggers for the given key function in the map, separating them with newlines.

(kf Functions)

Source from the content-addressed store, hash-verified

179// ChordFor returns all of the key chord triggers for the given
180// key function in the map, separating them with newlines.
181func (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.

Callers 1

ChordMethod · 0.80

Calls 2

ChordTypeAlias · 0.92
SortMethod · 0.45

Tested by

no test coverage detected