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

Method GetCurrentKeySet

Lib/idlelib/config.py:539–554  ·  view source on GitHub ↗

Return CurrentKeys with 'darwin' modifications.

(self)

Source from the content-addressed store, hash-verified

537 return binding
538
539 def GetCurrentKeySet(self):
540 "Return CurrentKeys with 'darwin' modifications."
541 result = self.GetKeySet(self.CurrentKeys())
542
543 if sys.platform == "darwin":
544 # macOS (OS X) Tk variants do not support the "Alt"
545 # keyboard modifier. Replace it with "Option".
546 # TODO (Ned?): the "Option" modifier does not work properly
547 # for Cocoa Tk and XQuartz Tk so we should not use it
548 # in the default 'OSX' keyset.
549 for k, v in result.items():
550 v2 = [ x.replace('<Alt-', '<Option-') for x in v ]
551 if v != v2:
552 result[k] = v2
553
554 return result
555
556 def GetKeySet(self, keySetName):
557 """Return event-key dict for keySetName core plus active extensions.

Callers 6

GetExtensionKeysMethod · 0.95
get_new_keysMethod · 0.80
RemoveKeybindingsMethod · 0.80
ApplyKeybindingsMethod · 0.80
mainmenu.pyFile · 0.80

Calls 4

GetKeySetMethod · 0.95
CurrentKeysMethod · 0.95
itemsMethod · 0.45
replaceMethod · 0.45

Tested by 1