Skip to content

Commit

Permalink
Handle Backspace properly on the Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
edreamleo committed Aug 1, 2018
1 parent 2b48584 commit 1e007f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions leo/core/leoKeys.py
Expand Up @@ -3048,7 +3048,7 @@ def masterKeyHandler(self, event):
k = self
# Setup...
if 'keys' in g.app.debug:
g.trace(repr(event.char), event.stroke)
g.trace(repr(k.state.kind), repr(event.char), event.stroke)
k.checkKeyEvent(event)
k.setEventWidget(event)
k.traceVars(event)
Expand Down Expand Up @@ -3479,7 +3479,6 @@ def handleMiniBindings(self, event, state, stroke):
'\n', 'Return',
'\t', 'Tab',
'Escape',
'Delete', ###
):
return False
if k.isFKey(stroke):
Expand Down
8 changes: 7 additions & 1 deletion leo/plugins/qt_events.py
Expand Up @@ -220,7 +220,13 @@ def doLateTweaks(self, binding, ch):
#@+node:ekr.20180419160958.1: *5* filter.doMacTweaks
def doMacTweaks(self, actual_ch, ch, mods):
'''Replace MacOS Alt characters.'''
if g.isMac and len(mods) == 1 and mods[0] == 'Alt':
### g.trace(repr(actual_ch), repr(ch))
if not g.isMac:
return actual_ch, ch, mods
if ch == 'Backspace':
# On the Mac, the reported char can be DEL (7F)
return '\b', ch, mods
if len(mods) == 1 and mods[0] == 'Alt':
# Patch provided by resi147.
# See the thread: special characters in MacOSX, like '@'.
mac_d = {
Expand Down

0 comments on commit 1e007f9

Please sign in to comment.