
Me vs Backspace: my war against a rogue character - spydez
http://lbrandy.com/blog/2010/07/me-vs-backspace/
======
snprbob86
This would be a good time to point out that OSX supports Emacs bindings in all
Cocoa text fields.

For example, you can press ctrl+a to go to the beginning of the line and
ctrl+e to go to the end of the line. The "Meta" modifier can be accessed via
alt+ctrl, so you can alt+ctrl+f to go forward a word, or alt+ctrl+b to go back
a word. Any motion can be combined with shift to select the text.

These are especially useful with the laptop keyboards. Bonus points if you
convert your caps lock key into an additional ctrl key:
<http://mkaz.com/archives/86/disable-caps-lock-on-mac-os-x/>

~~~
thought_alarm
Jacob Rus has an excellent and thorough write up of the Cocoa Text system:
[http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System....](http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html)

He provides a custom DefaultKeyBinding.dict which adds more emacs keybindings
to Cocoa text controls. I've been using it for years:
[http://www.hcs.harvard.edu/~jrus/Site/KeyBindings/Emacs%20Es...](http://www.hcs.harvard.edu/~jrus/Site/KeyBindings/Emacs%20Esc%20Bindings.dict)

------
TrevorBramble
Reminds me of finding out the hard way that "paste" is bound to Mouse3 by
default in Gnome and that on some mice I'll occasionally scroll the wheel
violently enough to trigger clicks.

Took a few times of finding random text in my code to realize what was
happening, and even longer to figure out how.

~~~
moultano
Another hilarious consequence. Firefox, if you try to middle click a link and
miss, would try to interpret whatever is in your paste buffer as an url. It
would do an i'm feeling lucky search on google and send you to that page.

For a long time I thought that opening links in a new tab would sometimes take
you instead to a random page on the internet.

~~~
zootm
You can get around this by turning on the "autoscroll" feature, since that's
activated by a middle-click. I've often wondered just who exactly Mozilla
thought the "paste in window goes to URL" feature was for; feels like the sort
of thing that gets left in because its fanbase includes one of the developers.

~~~
w1ntermute
It's a Unix thing, and AFAIK, only exists in the Linux version of Firefox. By
the way, you don't have to disable the autoscroll feature to disable this;
just go to about:config and toggle middlemouse.contentLoadURL to false.

------
fleitz
I've verified this issue using TextEdit saving the file and printing it using
"od -a".

I've also submitted it to bugreport.apple.com as bug # 8223684

------
bradleyland
Interesting. In my text editor (TextMate), I can reproduce this pretty
reliably using that key sequence.

~~~
bradleyland
Video: <http://www.youtube.com/watch?v=wLMNin-2p6A>

------
woodall
Here is another article I found on this, "Mac Delete Key Bug Demonstration".

<http://gunther.web66.com/crossjava/Bugs/deletekeybug/>

~~~
bradleyland
That's a different bug and is only relevant for Java apps. On a Mac, the
backspace key is labeled "delete", and the key associated with the action most
people refer to as "delete" is labeled with the delete special character[1].
Apple refers to this as the "forward delete" key. The bug described at the
link you provided does not require the shift or arrow keys to be pressed and
produces a different control character.

1 - <http://en.wikipedia.org/wiki/Delete_key>

~~~
thought_alarm
Fun historical note: The original Mac keyboard had a Backspace key rather than
a Delete key.
[http://www.vectronicsappleworld.com/collection/articlepics/5...](http://www.vectronicsappleworld.com/collection/articlepics/512ke/snap21.jpg)

The current Mac "Delete" key was inherited from the Apple IIgs ADB keyboard,
and it stuck around.

------
frossie
_I decided to wipe my Mac, reinstall the OS, and see if that fixed it._

So reinstalling the whole OS was higher up the troubleshooting chain than just
trying it out from your wife's computer? Err...

~~~
jerf
Piffle. Sure you can make that criticism _after_ he told you the answer. Could
you have told him _before_?

If you've never done the equivalent, it's only because you haven't been around
computers very long.

~~~
frossie
_If you've never done the equivalent, it's only because you haven't been
around computers very long._

Dude, in twenty years with computers I have never re-installed an OS to fix a
problem (obviously this is distinct from installing a _new_ version of the OS
which could legitimately have a fix for it). For me rebooting the computer is
even a last act of desperation that I am ashamed to take.

But then I am a unix/Linux user. I grant you the possibility that this may
somehow have been a rational act for MacOS, though if true I find that
disappointing.

------
hackermom
I do all the shift+arrow text marking with my right hand solely, incl.
cmd+backspace (delete) - and so, I never run into the problem of accidentally
inserting the $08 character anywhere.

But, yes, you are right, holding shift+any arrow key, while hitting backspace,
inserts a $08 by the OS X IME. This does depend on what kind of dialog you are
writing in (NSTextField, NSTextInput etc.), however, as not all of them
accepts this input. You can't input a backspace character this way in
Terminal.app, f.e.

