Return CurrentKeys with 'darwin' modifications.
(self)
| 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. |