Documentation ¶
Overview ¶
Package keymap implements maps from keyboard shortcuts to semantic GUI keyboard functions.
Index ¶
- Variables
- func SetActiveMap(km *Map, kmName MapName)
- func SetActiveMapName(mapnm MapName)
- type Functions
- func (kf Functions) Chord() key.Chord
- func (i Functions) Desc() string
- func (i Functions) Int64() int64
- func (kf Functions) Label() string
- func (i Functions) MarshalText() ([]byte, error)
- func (i *Functions) SetInt64(in int64)
- func (i *Functions) SetString(s string) error
- func (i Functions) String() string
- func (i *Functions) UnmarshalText(text []byte) error
- func (i Functions) Values() []enums.Enum
- type Map
- type MapItem
- type MapName
- type Maps
- type MapsItem
Constants ¶
This section is empty.
Variables ¶
var StandardMaps = Maps{ {"MacStandard", "Standard Mac KeyMap", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "Meta+UpArrow": MoveUp, "Control+P": MoveUp, "Control+Shift+P": MoveUp, "Control+Meta+P": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "Meta+DownArrow": MoveDown, "Control+N": MoveDown, "Control+Shift+N": MoveDown, "Control+Meta+N": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "Meta+RightArrow": End, "Control+F": MoveRight, "Control+Shift+F": MoveRight, "Control+Meta+F": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "Meta+LeftArrow": Home, "Control+B": MoveLeft, "Control+Shift+B": MoveLeft, "Control+Meta+B": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "Control+U": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Control+Shift+V": PageDown, "Alt+√": PageDown, "Alt+V": PageDown, "Meta+Home": DocHome, "Shift+Home": DocHome, "Meta+H": DocHome, "Meta+End": DocEnd, "Shift+End": DocEnd, "Meta+L": DocEnd, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Alt+RightArrow": WordRight, "Alt+Shift+RightArrow": WordRight, "Alt+LeftArrow": WordLeft, "Alt+Shift+LeftArrow": WordLeft, "Home": Home, "Control+A": Home, "Control+Shift+A": Home, "End": End, "Control+E": End, "Control+Shift+E": End, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Meta+A": SelectAll, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Meta+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Alt+Backspace": BackspaceWord, "Delete": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+D": Delete, "Control+K": Kill, "Alt+∑": Copy, "Alt+C": Copy, "Meta+C": Copy, "Control+W": Cut, "Meta+X": Cut, "Control+Y": Paste, "Control+V": Paste, "Meta+V": Paste, "Meta+Shift+V": PasteHist, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Meta+Z": Undo, "Control+Shift+Z": Redo, "Meta+Shift+Z": Redo, "Control+I": Insert, "Control+O": InsertAfter, "Meta+Shift+=": ZoomIn, "Meta+=": ZoomIn, "Meta+-": ZoomOut, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Meta+Shift+-": ZoomOut, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Control+S": Search, "Meta+F": Find, "Meta+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "Meta+[": HistPrev, "Meta+]": HistNext, "F10": Menu, "Control+M": Menu, "Meta+`": WinFocusNext, "Meta+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Meta+N": New, "Meta+Shift+N": NewAlt1, "Meta+Alt+N": NewAlt2, "Meta+O": Open, "Meta+Shift+O": OpenAlt1, "Meta+Alt+O": OpenAlt2, "Meta+S": Save, "Meta+Shift+S": SaveAs, "Meta+Alt+S": SaveAlt, "Meta+Shift+W": CloseAlt1, "Meta+Alt+W": CloseAlt2, }}, {"MacEmacs", "Mac with emacs-style navigation -- emacs wins in conflicts", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "Meta+UpArrow": MoveUp, "Control+P": MoveUp, "Control+Shift+P": MoveUp, "Control+Meta+P": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "Meta+DownArrow": MoveDown, "Control+N": MoveDown, "Control+Shift+N": MoveDown, "Control+Meta+N": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "Meta+RightArrow": End, "Control+F": MoveRight, "Control+Shift+F": MoveRight, "Control+Meta+F": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "Meta+LeftArrow": Home, "Control+B": MoveLeft, "Control+Shift+B": MoveLeft, "Control+Meta+B": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "Control+U": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Control+Shift+V": PageDown, "Alt+√": PageDown, "Alt+V": PageDown, "Control+V": PageDown, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Alt+RightArrow": WordRight, "Alt+Shift+RightArrow": WordRight, "Alt+LeftArrow": WordLeft, "Alt+Shift+LeftArrow": WordLeft, "Home": Home, "Control+A": Home, "Control+Shift+A": Home, "End": End, "Control+E": End, "Control+Shift+E": End, "Meta+Home": DocHome, "Shift+Home": DocHome, "Meta+H": DocHome, "Control+H": DocHome, "Control+Alt+A": DocHome, "Meta+End": DocEnd, "Shift+End": DocEnd, "Meta+L": DocEnd, "Control+Alt+E": DocEnd, "Alt+Ƒ": WordRight, "Alt+F": WordRight, "Alt+∫": WordLeft, "Alt+B": WordLeft, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Meta+A": SelectAll, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Meta+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Alt+Backspace": BackspaceWord, "Delete": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+D": Delete, "Control+K": Kill, "Alt+∑": Copy, "Alt+C": Copy, "Meta+C": Copy, "Control+W": Cut, "Meta+X": Cut, "Control+Y": Paste, "Meta+V": Paste, "Meta+Shift+V": PasteHist, "Control+Shift+Y": PasteHist, "Alt+∂": Duplicate, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Meta+Z": Undo, "Control+/": Undo, "Control+Shift+Z": Redo, "Meta+Shift+Z": Redo, "Control+I": Insert, "Control+O": InsertAfter, "Meta+Shift+=": ZoomIn, "Meta+=": ZoomIn, "Meta+-": ZoomOut, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Meta+Shift+-": ZoomOut, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Control+S": Search, "Meta+F": Find, "Meta+R": Replace, "Control+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "Meta+[": HistPrev, "Meta+]": HistNext, "F10": Menu, "Control+M": Menu, "Meta+`": WinFocusNext, "Meta+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Meta+N": New, "Meta+Shift+N": NewAlt1, "Meta+Alt+N": NewAlt2, "Meta+O": Open, "Meta+Shift+O": OpenAlt1, "Meta+Alt+O": OpenAlt2, "Meta+S": Save, "Meta+Shift+S": SaveAs, "Meta+Alt+S": SaveAlt, "Meta+Shift+W": CloseAlt1, "Meta+Alt+W": CloseAlt2, }}, {"LinuxEmacs", "Linux with emacs-style navigation -- emacs wins in conflicts", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "Alt+UpArrow": MoveUp, "Control+P": MoveUp, "Control+Shift+P": MoveUp, "Control+Alt+P": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "Alt+DownArrow": MoveDown, "Control+N": MoveDown, "Control+Shift+N": MoveDown, "Control+Alt+N": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "Alt+RightArrow": End, "Control+F": MoveRight, "Control+Shift+F": MoveRight, "Control+Alt+F": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "Alt+LeftArrow": Home, "Control+B": MoveLeft, "Control+Shift+B": MoveLeft, "Control+Alt+B": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "Control+U": PageUp, "Control+Shift+U": PageUp, "Control+Alt+U": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Control+V": PageDown, "Control+Shift+V": PageDown, "Control+Alt+V": PageDown, "Alt+Home": DocHome, "Shift+Home": DocHome, "Alt+H": DocHome, "Control+Alt+A": DocHome, "Alt+End": DocEnd, "Shift+End": DocEnd, "Alt+L": DocEnd, "Control+Alt+E": DocEnd, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Home": Home, "Control+A": Home, "Control+Shift+A": Home, "End": End, "Control+E": End, "Control+Shift+E": End, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Alt+A": SelectAll, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Delete": Delete, "Control+D": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+K": Kill, "Alt+W": Copy, "Alt+C": Copy, "Control+W": Cut, "Alt+X": Cut, "Control+Y": Paste, "Alt+V": Paste, "Alt+Shift+V": PasteHist, "Control+Shift+Y": PasteHist, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Control+/": Undo, "Control+Shift+Z": Redo, "Control+I": Insert, "Control+O": InsertAfter, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Control+S": Search, "Alt+F": Find, "Control+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "F10": Menu, "Control+M": Menu, "Alt+F6": WinFocusNext, "Control+Shift+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Alt+N": New, "Alt+Shift+N": NewAlt1, "Alt+O": Open, "Alt+Shift+O": OpenAlt1, "Control+Alt+O": OpenAlt2, "Alt+S": Save, "Alt+Shift+S": SaveAs, "Control+Alt+S": SaveAlt, "Alt+Shift+W": CloseAlt1, "Control+Alt+W": CloseAlt2, }}, {"LinuxStandard", "Standard Linux KeyMap", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Home": Home, "Alt+LeftArrow": Home, "End": End, "Alt+Home": DocHome, "Shift+Home": DocHome, "Alt+End": DocEnd, "Shift+End": DocEnd, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Alt+RightArrow": End, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Control+A": SelectAll, "Control+Shift+A": CancelSelect, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Delete": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+K": Kill, "Control+C": Copy, "Control+X": Cut, "Control+V": Paste, "Control+Shift+V": PasteHist, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Control+Y": Redo, "Control+Shift+Z": Redo, "Control+Alt+I": Insert, "Control+Alt+O": InsertAfter, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Alt+S": Search, "Control+F": Find, "Control+H": Replace, "Control+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "Control+N": New, "F10": Menu, "Control+M": Menu, "Alt+F6": WinFocusNext, "Control+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Control+Shift+N": NewAlt1, "Control+Alt+N": NewAlt2, "Control+O": Open, "Control+Shift+O": OpenAlt1, "Alt+Shift+O": OpenAlt2, "Control+S": Save, "Control+Shift+S": SaveAs, "Control+Alt+S": SaveAlt, "Control+Shift+W": CloseAlt1, "Control+Alt+W": CloseAlt2, }}, {"WindowsStandard", "Standard Windows KeyMap", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Home": Home, "Alt+LeftArrow": Home, "End": End, "Alt+RightArrow": End, "Alt+Home": DocHome, "Shift+Home": DocHome, "Alt+End": DocEnd, "Shift+End": DocEnd, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Control+A": SelectAll, "Control+Shift+A": CancelSelect, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Delete": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+K": Kill, "Control+C": Copy, "Control+X": Cut, "Control+V": Paste, "Control+Shift+V": PasteHist, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Control+Y": Redo, "Control+Shift+Z": Redo, "Control+Alt+I": Insert, "Control+Alt+O": InsertAfter, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Alt+S": Search, "Control+F": Find, "Control+H": Replace, "Control+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "F10": Menu, "Control+M": Menu, "Alt+F6": WinFocusNext, "Control+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Control+N": New, "Control+Shift+N": NewAlt1, "Control+Alt+N": NewAlt2, "Control+O": Open, "Control+Shift+O": OpenAlt1, "Alt+Shift+O": OpenAlt2, "Control+S": Save, "Control+Shift+S": SaveAs, "Control+Alt+S": SaveAlt, "Control+Shift+W": CloseAlt1, "Control+Alt+W": CloseAlt2, }}, {"ChromeStd", "Standard chrome-browser and linux-under-chrome bindings", Map{ "UpArrow": MoveUp, "Shift+UpArrow": MoveUp, "DownArrow": MoveDown, "Shift+DownArrow": MoveDown, "RightArrow": MoveRight, "Shift+RightArrow": MoveRight, "LeftArrow": MoveLeft, "Shift+LeftArrow": MoveLeft, "PageUp": PageUp, "Shift+PageUp": PageUp, "Control+UpArrow": PageUp, "PageDown": PageDown, "Shift+PageDown": PageDown, "Control+DownArrow": PageDown, "Home": Home, "Alt+LeftArrow": Home, "End": End, "Alt+Home": DocHome, "Shift+Home": DocHome, "Alt+End": DocEnd, "Shift+End": DocEnd, "Control+RightArrow": WordRight, "Control+LeftArrow": WordLeft, "Alt+RightArrow": End, "Tab": FocusNext, "Shift+Tab": FocusPrev, "ReturnEnter": Enter, "KeypadEnter": Enter, "Control+A": SelectAll, "Control+Shift+A": CancelSelect, "Control+G": CancelSelect, "Control+Spacebar": SelectMode, "Control+ReturnEnter": Accept, "Escape": Abort, "Backspace": Backspace, "Control+Backspace": BackspaceWord, "Delete": Delete, "Control+Delete": DeleteWord, "Alt+Delete": DeleteWord, "Control+K": Kill, "Control+C": Copy, "Control+X": Cut, "Control+V": Paste, "Control+Shift+V": PasteHist, "Alt+D": Duplicate, "Control+T": Transpose, "Alt+T": TransposeWord, "Control+Z": Undo, "Control+Y": Redo, "Control+Shift+Z": Redo, "Control+Alt+I": Insert, "Control+Alt+O": InsertAfter, "Control+=": ZoomIn, "Control+Shift++": ZoomIn, "Control+-": ZoomOut, "Control+Shift+_": ZoomOut, "F5": Refresh, "Control+L": Recenter, "Control+.": Complete, "Control+,": Lookup, "Alt+S": Search, "Control+F": Find, "Control+H": Replace, "Control+R": Replace, "Control+J": Jump, "Control+[": HistPrev, "Control+]": HistNext, "F10": Menu, "Control+M": Menu, "Alt+F6": WinFocusNext, "Control+W": WinClose, "Control+Alt+G": WinSnapshot, "Control+Shift+G": WinSnapshot, "Control+N": New, "Control+Shift+N": NewAlt1, "Control+Alt+N": NewAlt2, "Control+O": Open, "Control+Shift+O": OpenAlt1, "Alt+Shift+O": OpenAlt2, "Control+S": Save, "Control+Shift+S": SaveAs, "Control+Alt+S": SaveAlt, "Control+Shift+W": CloseAlt1, "Control+Alt+W": CloseAlt2, }}, }
StandardMaps is the original compiled-in set of standard keymaps that have the lastest key functions bound to standard key chords.
Functions ¶
func SetActiveMap ¶
SetActiveMap sets the current ActiveKeyMap, calling Update on the map prior to setting it to ensure that it is a valid, complete map
func SetActiveMapName ¶
func SetActiveMapName(mapnm MapName)
SetActiveMapName sets the current ActiveKeyMap by name from those defined in AvailKeyMaps, calling Update on the map prior to setting it to ensure that it is a valid, complete map
Types ¶
type Functions ¶
type Functions int32 //enums:enum
Functions are semantic functions that keyboard events can perform in the GUI.
const ( None Functions = iota MoveUp MoveDown MoveRight MoveLeft PageUp PageDown // PageRight // PageLeft Home // start-of-line End // end-of-line DocHome // start-of-doc -- Control / Alt / Shift +Home DocEnd // end-of-doc Control / Alt / Shift +End WordRight WordLeft FocusNext // Tab FocusPrev // Shift-Tab Enter // Enter / return key -- has various special functions Accept // Ctrl+Enter = accept any changes and close dialog / move to next CancelSelect SelectMode SelectAll Abort // EditItem Copy Cut Paste PasteHist // from history Backspace BackspaceWord Delete DeleteWord Kill Duplicate Transpose TransposeWord Undo Redo Insert InsertAfter ZoomOut ZoomIn Refresh Recenter // Ctrl+L in emacs Complete Lookup Search // Ctrl+S in emacs -- more interactive type of search Find // Command+F full-dialog find Replace Jump // jump to line HistPrev HistNext Menu // put focus on menu WinFocusNext WinClose WinSnapshot // Below are menu specific functions -- use these as shortcuts for menu buttons // allows uniqueness of mapping and easy customization of all key buttons New NewAlt1 // alternative version (e.g., shift) NewAlt2 // alternative version (e.g., alt) Open OpenAlt1 // alternative version (e.g., shift) OpenAlt2 // alternative version (e.g., alt) Save SaveAs SaveAlt // another alt (e.g., alt) CloseAlt1 // alternative version (e.g., shift) CloseAlt2 // alternative version (e.g., alt) )
const FunctionsN Functions = 64
FunctionsN is the highest valid value for type Functions, plus one.
func FunctionsValues ¶
func FunctionsValues() []Functions
FunctionsValues returns all possible values for the type Functions.
func (Functions) Chord ¶
Chord returns all of the key chord triggers for this key function in the current active map, separating them with newlines.
func (Functions) Label ¶
Label transforms the key function into a string representing its underlying key chord(s) in a form suitable for display to users.
func (Functions) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Functions) SetString ¶
SetString sets the Functions value from its string representation, and returns an error if the string is invalid.
func (*Functions) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Map ¶
Map is a map between a key sequence (chord) and a specific key function. This mapping must be unique, in that each chord has a unique function, but multiple chords can trigger the same function.
var ActiveMap *Map
ActiveMap points to the active map -- users can set this to an alternative map in Settings
func (*Map) ChordFor ¶
ChordFor returns all of the key chord triggers for the given key function in the map, separating them with newlines.
type MapItem ¶
type MapItem struct { // the key chord that activates a function Key key.Chord // the function of that key Fun Functions }
MapItem records one element of the key map, which is used for organizing the map.
type MapName ¶
type MapName string
MapName has an associated Value for selecting from the list of available key map names, for use in preferences etc.
var ActiveMapName MapName
ActiveMapName is the name of the active keymap
var DefaultMap MapName = "LinuxStandard"
DefaultMap is the overall default keymap, which is set in init depending on the platform
type Maps ¶
type Maps []MapsItem //types:add
Maps is a list of [MapsItem]s; users can edit these in their settings.
var AvailableMaps Maps
AvailableMaps is the current list of available keymaps for use. This can be loaded / saved / edited in user settings. This is set to StandardMaps at startup.
func (*Maps) MapByName ¶
MapByName returns a Map and index by name. It returns false and prints an error message if not found.
func (*Maps) MarkdownDoc ¶
MarkdownDoc generates a markdown table of all the key mappings
type MapsItem ¶
type MapsItem struct { // name of keymap Name string `width:"20"` // description of keymap; good idea to include source it was derived from Desc string // to edit key sequence click button and type new key combination; to edit function mapped to key sequence choose from menu Map Map }
MapsItem is an entry in a Maps list
func (*MapsItem) SetDesc ¶
SetDesc sets the [MapsItem.Desc]: description of keymap; good idea to include source it was derived from