Monday, June 27, 2016

Hopes no longer dashed in Windows 10

I have largely weaned myself off of my old Mac laptop (a 2010 MacBook Pro) in favour of my newer, spiffier Microsoft Surface Pro 3. The SP3 is slim, weighs less than a kilo, which makes it a dream to carry about, and has functionality that a Mac can only dream of (a touchscreen! a stylus!) The Mac is now retired to sofa duty in my living room, while the SP3 is my new world travelling companion.

But not everything is automatically better. At least, not right away. There are a few little things that were so easy to do on the Mac that are nigh-on impossible in the Windows 10 operating system on the SP3. And the one that really bugs me is a little bit grammar-nerdy: en-dashes.

As an undergrad, I used to work as a sub-editor on the university newspaper. In essence, my job was to proofread chunks of the copy that eventually made it onto the pages. And one of the most common corrections I had to make was switching hyphens - these weedy things - for en-dashes. The en-dash is a dash the width of an 'n' – a far more satisfying size – and is just the thing to add emphasis or clarification to a sentence.

On a Mac, you could get an en-dash by typing <option><hyphen>, but there is no easy equivalent for Windows. Within certain applications, like Word, you can set macros to autocorrect to dashes, but that doesn't exactly help with typing in a web browser (say). Some websites suggest that you can get there with Alt-codes, but the big catch there is that you need a full-size keyboard with numeric keypad to get those to work. Which the SP3 is notably lacking in. Well, today, I spent some time googling the problem, and was heartened to find that a) I was not the only person obsessing over dashes, and b) at least one of those people had figured out a fix:
AutoHotKey is the simple solution to this problem. It's a free app that lets you set keystroke combinations to perform any action in any application, including browsers. I was able to map en and em dashes to alt-hyphen and shift-alt-hyphen, respectively. Works flawlessly — every time. (See what I did there?)
You'll see some discussion about this not working with Windows 10, but that's old discussion. It's working for me on my Surface Pro 4 just dandily as of January 21, 2016.
Here's what you do:
1. Download and run AutoHotKey (autohotkey.com)
2. Right-click on your desktop, and choose New > AutoHotKey Script. Name the script with a .ahk at the end.
3. Right-click the script, and select Edit Script.
4. Paste this code in that script below the existing text:
!-::–
return

+!-::—
return
5. Save, close and double-click the script to run it. Test it out in some random program. You'll see it now works.
6. Make a shortcut of the script, and move it to your Startup Items folder. (Windows-R, then type "shell:startup" to open the Startup folder.) Drag your shortcut into it.
I followed the instructions, and can confirm that they work a treat. Now to write some dashing prose!

Hat tip: David R Nagel on this thread.

No comments:

Post a Comment