Bind a shortcut key.
(
self,
contexts: Sequence[str],
key: str,
cmd: mitmproxy.types.Cmd,
*args: mitmproxy.types.CmdArgs,
)
| 688 | |
| 689 | @command.command("console.key.bind") |
| 690 | def key_bind( |
| 691 | self, |
| 692 | contexts: Sequence[str], |
| 693 | key: str, |
| 694 | cmd: mitmproxy.types.Cmd, |
| 695 | *args: mitmproxy.types.CmdArgs, |
| 696 | ) -> None: |
| 697 | """ |
| 698 | Bind a shortcut key. |
| 699 | """ |
| 700 | try: |
| 701 | self.master.keymap.add(key, cmd + " " + " ".join(args), contexts, "") |
| 702 | except ValueError as v: |
| 703 | raise exceptions.CommandError(v) |
| 704 | |
| 705 | @command.command("console.key.unbind") |
| 706 | def key_unbind(self, contexts: Sequence[str], key: str) -> None: |