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

Method GetCoreKeys

Lib/idlelib/config.py:592–688  ·  view source on GitHub ↗

Return dict of core virtual-key keybindings for keySetName. The default keySetName None corresponds to the keyBindings base dict. If keySetName is not None, bindings from the config file(s) are loaded _over_ these defaults, so if there is a problem getting any core b

(self, keySetName=None)

Source from the content-addressed store, hash-verified

590 }
591
592 def GetCoreKeys(self, keySetName=None):
593 """Return dict of core virtual-key keybindings for keySetName.
594
595 The default keySetName None corresponds to the keyBindings base
596 dict. If keySetName is not None, bindings from the config
597 file(s) are loaded _over_ these defaults, so if there is a
598 problem getting any core binding there will be an 'ultimate last
599 resort fallback' to the CUA-ish bindings defined here.
600 """
601 # TODO: = dict(sorted([(v-event, keys), ...]))?
602 keyBindings={
603 # virtual-event: list of key events.
604 '<<copy>>': ['<Control-c>', '<Control-C>'],
605 '<<cut>>': ['<Control-x>', '<Control-X>'],
606 '<<paste>>': ['<Control-v>', '<Control-V>'],
607 '<<beginning-of-line>>': ['<Control-a>', '<Home>'],
608 '<<center-insert>>': ['<Control-l>'],
609 '<<close-all-windows>>': ['<Control-q>'],
610 '<<close-window>>': ['<Alt-F4>'],
611 '<<do-nothing>>': ['<Control-x>'],
612 '<<end-of-file>>': ['<Control-d>'],
613 '<<python-docs>>': ['<F1>'],
614 '<<python-context-help>>': ['<Shift-F1>'],
615 '<<history-next>>': ['<Alt-n>'],
616 '<<history-previous>>': ['<Alt-p>'],
617 '<<interrupt-execution>>': ['<Control-c>'],
618 '<<view-restart>>': ['<F6>'],
619 '<<restart-shell>>': ['<Control-F6>'],
620 '<<open-class-browser>>': ['<Alt-c>'],
621 '<<open-module>>': ['<Alt-m>'],
622 '<<open-new-window>>': ['<Control-n>'],
623 '<<open-window-from-file>>': ['<Control-o>'],
624 '<<plain-newline-and-indent>>': ['<Control-j>'],
625 '<<print-window>>': ['<Control-p>'],
626 '<<redo>>': ['<Control-y>'],
627 '<<remove-selection>>': ['<Escape>'],
628 '<<save-copy-of-window-as-file>>': ['<Alt-Shift-S>'],
629 '<<save-window-as-file>>': ['<Alt-s>'],
630 '<<save-window>>': ['<Control-s>'],
631 '<<select-all>>': ['<Alt-a>'],
632 '<<toggle-auto-coloring>>': ['<Control-slash>'],
633 '<<undo>>': ['<Control-z>'],
634 '<<find-again>>': ['<Control-g>', '<F3>'],
635 '<<find-in-files>>': ['<Alt-F3>'],
636 '<<find-selection>>': ['<Control-F3>'],
637 '<<find>>': ['<Control-f>'],
638 '<<replace>>': ['<Control-h>'],
639 '<<goto-line>>': ['<Alt-g>'],
640 '<<smart-backspace>>': ['<Key-BackSpace>'],
641 '<<newline-and-indent>>': ['<Key-Return>', '<Key-KP_Enter>'],
642 '<<smart-indent>>': ['<Key-Tab>'],
643 '<<indent-region>>': ['<Control-Key-bracketright>'],
644 '<<dedent-region>>': ['<Control-Key-bracketleft>'],
645 '<<comment-region>>': ['<Alt-Key-3>'],
646 '<<uncomment-region>>': ['<Alt-Key-4>'],
647 '<<tabify-region>>': ['<Alt-Key-5>'],
648 '<<untabify-region>>': ['<Alt-Key-6>'],
649 '<<toggle-tabs>>': ['<Alt-Key-t>'],

Callers 4

GetKeySetMethod · 0.95
IsCoreBindingMethod · 0.95
create_new_key_setMethod · 0.80
test_get_core_keysMethod · 0.80

Calls 3

GetKeyBindingMethod · 0.95
has_sectionMethod · 0.80
_warnFunction · 0.70

Tested by 1

test_get_core_keysMethod · 0.64