#pragma section-numbers on <> = define_key = Define_key has three positional arguments and three permitted keyword arguments. == Arguments == === kmap === The keymap in which to bind. See [[Keymaps]] to help find the most appropriate keymap for the binding you want to create. === seq === The key sequence, given as a string, or a match predicate function. === cmd === 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. null:: :: 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`. === $fallthrough === 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. === $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. === $browser_object = ob === The given object will be used as the default browser object for the bound command. = undefine_key = Takes two positional arguments, kmap and seq. Undefines the binding given by seq in kmap. = Examples = == Default Browser Object == This binds the key 'y' in content buffers to the 'copy' command, and will cause it to prompt for any DOM node, instead of just links: {{{ define_key(content_buffer_normal_keymap, "y", "copy", $browser_object = browser_object_dom_node); }}}