Define_key has three positional arguments and three permitted keyword arguments.
The keymap in which to bind. See Keymaps to help find the most appropriate keymap for the binding you want to create.
The key sequence, given as a string, or a match predicate function.
This can be one of three types:
- a string
- The command named by the string is called when this binding is called.
- a keymap
- The given keymap becomes active when this binding is called.
Normally given when the $fallthrough keyword is given, signifying no action other than fallthrough. If null is given for cmd when the $fallthrough keyword is not given, the result is the same as undefine_key.
When this keyword is given to define_key, it marks the binding as a fallthrough binding. This tells the input system to allow the keypress event to fall through to Gecko for processing by Gecko or the document in the current buffer.
1.5. $repeat = cmd
The given command will be called if this binding is called twice in a row. This is the mechanism by which sequences like ] ] work.
1.6. $browser_object = ob
The given object will be used as the default browser object for the bound command.