How can I release the Win-L key combination to the underlying program?

0

I'm a Mac user (boo, hiss, I know) who's occasionally working on a Windows 8.1 partition on his Macbook. I've used AutoHotKey to remap several keys, and make my life easier by sharing the same general keyboard-shortcuts between OS X and Windows.

Most crucially, I've swapped RCtrl and RWin, because the primary modifier key on OS X (Command) is right next to the space-bar, accessible by the thumb; instead of being off in the corner, something you have to stretch for with your pinkie-finger, as the primary modifier key is on Windows (Ctrl). (I much prefer "Thumb-W" to close a window, for instance, to "Contort-Hand-and-Attempt-Pinkie-W".)


The problem I'm running into, is one of my most-used keyboard shortcuts: command-L on OS X, in Chrome or Safari. This focuses the URL bar. Unfortunately, on Windows, win-L is apparently perma-mapped by default to lock the screen, and AutoHotKey makes no attempt to remap that. My muscle memory has me accidentally locking my screen every couple minutes, and it's driving me nuts.

I've dug out a registry-hack that completely disables the "workstation lock" feature of Windows, and that's half-solved the problem for me; but now, although it no longer locks my machine, neither can I figure out how to remap it to do anything else.

Here's the relevant part of my AutoHotKey script; can somebody tell me how to modify this to actually work (with "DisableLockWorkstation" enabled) on Windows 8.1?

#l::^l
#r::^r

RCtrl::RWin
RWin::RCtrl
LCtrl::LWin
LWin::LCtrl

Edit 1: I've tried some more experimenting, and discovered that AutoHotKey straight-up refuses to even capture win-L. Out of the following, the first two cause windows, but the latter has no effect:

!l::MsgBox, "You pressed Alt-L"
^l::MsgBox, "You pressed Ctrl-L"
#l::MsgBox, "You pressed Win-L"

ELLIOTTCABLE

Posted 2014-06-17T10:04:26.273

Reputation: 1 207

@MCL: That didn't work; and I also added relevant information to the original post – ELLIOTTCABLE – 2014-06-18T20:11:35.737

@karoma: the problem doesn't seem to be in the sending of Ctrl-L, but in the capturing of Win-L. See my original post, I updated it. – ELLIOTTCABLE – 2014-06-18T20:12:24.050

The same seems to be true in Windows 7. (Actually, it appears that the hotkey runs but Windows also gets locked.) – echristopherson – 2014-06-19T17:43:01.633

@echristopherson did it get locked after you disabled it with the registry modification? – ELLIOTTCABLE – 2014-06-24T14:05:03.857

I hadn't tried that until just now. But when I did, the hotkey fired and the system didn't get locked. (I restarted after making the registry change; maybe just logging back in would have sufficed.) – echristopherson – 2014-06-24T17:21:27.970

I wonder if that's a 7-vs-8 difference, or if I'm just doing something wrong. What's your exact script? – ELLIOTTCABLE – 2014-06-24T18:06:55.870

What happens when you revert your RCtrl and RWin keys back to normal? Does LWin + L do anything? – Cfinley – 2014-08-05T14:24:39.697

This doesn't exactly answer your question, but it might eliminate the problem: F6 will focus the URL bar in most browsers. – karoma – 2014-06-17T12:33:13.137

Try this: $#l::^l or alternatively: $#l::Send, ^l – MCL – 2014-06-17T14:19:19.630

No answers