MCPcopy Index your code
hub / github.com/python/cpython / set_modifiers_for_platform

Method set_modifiers_for_platform

Lib/idlelib/config_key.py:169–181  ·  view source on GitHub ↗

Determine list of names of key modifiers for this platform. The names are used to build Tk bindings -- it doesn't matter if the keyboard has these keys; it matters if Tk understands them. The order is also important: key binding equality depends on it, so config-key

(self)

Source from the content-addressed store, hash-verified

167 self.toggle_level()
168
169 def set_modifiers_for_platform(self):
170 """Determine list of names of key modifiers for this platform.
171
172 The names are used to build Tk bindings -- it doesn't matter if the
173 keyboard has these keys; it matters if Tk understands them. The
174 order is also important: key binding equality depends on it, so
175 config-keys.def must use the same ordering.
176 """
177 if sys.platform == "darwin":
178 self.modifiers = ['Shift', 'Control', 'Option', 'Command']
179 else:
180 self.modifiers = ['Control', 'Alt', 'Shift']
181 self.modifier_label = {'Control': 'Ctrl'} # Short name.
182
183 def toggle_level(self):
184 "Toggle between basic and advanced keys."

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected