MCPcopy
hub / github.com/Textualize/textual / parse_key

Method parse_key

src/textual/binding.py:100–107  ·  view source on GitHub ↗

Parse a key into a list of modifiers, and the actual key. Returns: A tuple of (MODIFIER LIST, KEY).

(self)

Source from the content-addressed store, hash-verified

98 """Optional binding group (used to group related bindings in the footer)."""
99
100 def parse_key(self) -> tuple[list[str], str]:
101 """Parse a key into a list of modifiers, and the actual key.
102
103 Returns:
104 A tuple of (MODIFIER LIST, KEY).
105 """
106 *modifiers, key = self.key.split("+")
107 return modifiers, key
108
109 def with_key(self, key: str, key_display: str | None = None) -> Binding:
110 """Return a new binding with the key and key_display set to the specified values.

Callers 1

get_key_displayMethod · 0.80

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected