diff -r 25fd9aeeff91 Lib/idlelib/configHandler.py --- a/Lib/idlelib/configHandler.py Thu Jun 12 01:03:08 2014 -0400 +++ b/Lib/idlelib/configHandler.py Thu Jun 12 16:28:40 2014 +0530 @@ -19,6 +19,7 @@ """ import os import sys +import re from configparser import ConfigParser, NoOptionError, NoSectionError @@ -526,14 +527,21 @@ def GetCurrentKeySet(self): result = self.GetKeySet(self.CurrentKeys()) - if sys.platform == "darwin": - # OS X Tk variants do not support the "Alt" keyboard modifier. - # So replace all keybingings that use "Alt" with ones that - # use the "Option" keyboard modifier. - # TO DO: the "Option" modifier does not work properly for - # Cocoa Tk and XQuartz Tk so we should not use it - # in default OS X KeySets. - for k, v in result.items(): + def replace(m): + return m.group('prefix') + m.group('alpha').swapcase()+'>' + + pat = '(?P<[A-Za-z-]+Key-)(?P[a-zA-Z])>' + for k, v in result.items(): + v2 = [re.sub(pat, replace, x) for x in v] + if v != v2: + v.extend(v2) + if sys.platform == "darwin": + # OS X Tk variants do not support the "Alt" keyboard modifier. + # So replace all keybingings that use "Alt" with ones that + # use the "Option" keyboard modifier. + # TO DO: the "Option" modifier does not work properly for + # Cocoa Tk and XQuartz Tk so we should not use it + # in default OS X KeySets. v2 = [ x.replace('