MCPcopy Create free account
hub / github.com/SolarLune/masterplan / DefineKeyShortcut

Method DefineKeyShortcut

keybindings.go:425–431  ·  view source on GitHub ↗
(bindingName string, keyCode sdl.Keycode, mods ...sdl.Keycode)

Source from the content-addressed store, hash-verified

423}
424
425func (kb *Keybindings) DefineKeyShortcut(bindingName string, keyCode sdl.Keycode, mods ...sdl.Keycode) *Shortcut {
426 sc := NewShortcut(bindingName)
427 sc.SetKeys(keyCode, mods...)
428 kb.Shortcuts[bindingName] = sc
429 kb.ShortcutsInOrder = append(kb.ShortcutsInOrder, sc)
430 return sc
431}
432
433func (kb *Keybindings) DefineMouseShortcut(bindingName string, mouseButton uint8) *Shortcut {
434 sc := NewShortcut(bindingName)

Callers 1

DefaultMethod · 0.95

Calls 2

SetKeysMethod · 0.95
NewShortcutFunction · 0.85

Tested by

no test coverage detected