MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / keypress

Method keypress

mitmproxy/tools/console/searchable.py:25–41  ·  view source on GitHub ↗
(self, size, key: str)

Source from the content-addressed store, hash-verified

23 self.last_search = None
24
25 def keypress(self, size, key: str):
26 if key == "/":
27 signals.status_prompt.send(
28 prompt="Search for", text="", callback=self.set_search
29 )
30 elif key == "n":
31 self.find_next(False)
32 elif key == "N":
33 self.find_next(True)
34 elif key == "m_start":
35 self.set_focus(0)
36 self.walker._modified()
37 elif key == "m_end":
38 self.set_focus(len(self.walker) - 1)
39 self.walker._modified()
40 else:
41 return super().keypress(size, key)
42
43 def set_search(self, text):
44 self.last_search = text

Callers

nothing calls this directly

Calls 4

find_nextMethod · 0.95
_modifiedMethod · 0.80
sendMethod · 0.45
set_focusMethod · 0.45

Tested by

no test coverage detected