MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / keypress

Method keypress

mitmproxy/tools/console/grideditor/base.py:329–354  ·  view source on GitHub ↗
(self, size, key)

Source from the content-addressed store, hash-verified

327 self.walker.set_value(val, focus, focus_col)
328
329 def keypress(self, size, key):
330 if self.walker.edit_row:
331 if key == "esc":
332 self.walker.stop_edit()
333 elif key == "tab":
334 pf, pfc = self.walker.focus, self.walker.focus_col
335 self.walker.tab_next()
336 if self.walker.focus == pf and self.walker.focus_col != pfc:
337 self.walker.start_edit()
338 else:
339 self._w.keypress(size, key)
340 return None
341
342 column = self.columns[self.walker.focus_col]
343 if key == "m_start":
344 self.walker.set_focus(0)
345 elif key == "m_next":
346 self.walker.tab_next()
347 elif key == "m_end":
348 self.walker.set_focus(len(self.walker.lst) - 1)
349 elif key == "left":
350 self.walker.left()
351 elif key == "right":
352 self.walker.right()
353 elif column.keypress(key, self) and not self.handle_key(key):
354 return self._w.keypress(size, key)
355
356 def data_out(self, data: Sequence[list]) -> Any:
357 """

Callers

nothing calls this directly

Calls 8

handle_keyMethod · 0.95
stop_editMethod · 0.80
tab_nextMethod · 0.80
start_editMethod · 0.80
keypressMethod · 0.45
set_focusMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected