|
mac geekeryGet your geek on. |
Bring Back a Proper Textual Drag and DropNovember 17, 2005 - 9:13am
Since moving to Mac OS X my biggest peeve, other than random slowness, is that when I go to drag a block of text the only sure-fire way of making it drag immediately is to aim the insertion cursor’s tiny cross-hairs right on the black of a glyph and then start the drag. That is a crazy man’s drag-and-drop. Then, recently, I learned two things about drag-and-drop in Mac OS X. The first is that while that method works, an easier method is to just click and hold on the text for about a second and then move your mouse and drag it. Works every time, now. However, that method is lacking as well in that it doesn’t approach the pure usability of Mac OS 9’s drag-and-drop of text in that all one had to do was click and move. No aiming, no delay. It just did it. Well, you can bring that back. When looking at Xcode’s “expert” preferences document, Apple gives the tip of setting defaults write -g NSDragAndDropTextDelay -int 1 This is setting the value in sudo defaults write /Library/Preferences/.GlobalPreferences.plist NSDragAndDropTextDelay -int 1 After doing either step, all newly-launched programs will get this preference and drag-and-drop will be immediate. The value is in milliseconds so if you want something shorter but not instant you can go with 100 (1/10th of a second) or so. This way when you go to re-select text that includes selected text it won’t move it, which is, it would appear, what the delay is all about. The default time is just a bit long for me. About Adam Knight |
|
The problem with this type of setting is that if the interval is too short, any 'drag', whether desired or not, will result in a block move (which usually requires the 'cmd+z undo ritual' (you can also cancel the op, by hitting esc). If the setting is is too high, it doesn't do it at all. Early implementations were more eager to do text d&d than current ones. The flip part is that when you do want to do it, ie, select something on a web page, drag the text over to Mail.app's icon to create a new message with the selection, it does not do it.
I for one use copy/paste instead inside of an app, but like d&d for inter-app text copies. I wish there was way of saying never allow same document drags, but allow inter app/doc drags/copy.
This has irritated me for ages now, so many thanks for finding a solution.
In case of regret, however, do you know what Apple’s original default value is?
In case of regret open either file in Property List Editor and remove that key entirely. I do not know the original value, but that would reset it to whatever it was.
—
cp
Just delete the entry in the defaults database to go back to the default value. From a shell prompt, type:
defaults delete -g NSDragAndDropTextDelayAhh! The necessity to target a glyph explains the mystery behind the frustrating randomness of text drag/drop attempts sometimes failing to grab text blocks and create new unwanted selections instead. I infrequently drag/drop text that way but it recently fuddled a simple demonstration to someone of how to put text clippings on the Desktop. So, thanks for clueing me in to this even if I don’t tweak NSDragAndDropTextDelay. That info alone is worth my rating your post a 9/10.
Hi. Now that you’ve solved my problem about the timing setting on drag & drop text (and many congratulations to you for doing that), now what do I do about controlling that third click (double click to select, pause one-tenth of a second, click to drag text) which controls the selection of the whole line of text. Can I delay that action? thanks, AB
The “how long does it take to do a text clipping” delay is a way to tell if an app is Cocoa or not. There are two behaviors that are reversed between the Carbon and Cocoa. One is the text clipping issue. More-or-less instantaneous clipping indicates a Carbon app. LIkewise, if you try and drag a proxy icon (the little icon in a window’s title bar), Cocoa apps are near instantaneous while Carbon apps have a delay before you can drag the proxy icon (note, I’m not talking about moving a window)