Your computer locks when you press L because Windows is reading the keystroke as Windows key + L, the shortcut that locks the PC. Something is making Windows think the Windows key is held down, and the usual suspects are a stuck key, a remap or macro that sends the Windows key, or a keyboard feature that holds modifier keys.
The lock itself is not a fault. Microsoft's shortcut list describes Windows logo key + L as "Lock the computer" in Windows 11 and "Lock your PC" in Windows 10. The fault is that the Windows key is "pressed" when you did not press it. The steps below find which key or program is responsible, starting with the quickest checks.
Step 1: Check whether the Windows key is really stuck
Do this before changing any setting. It takes about a minute and separates a hardware problem from a software one.
- Press and release the Windows key once. The Start menu should open. Press Esc to close it.
- Press the Windows key on the other side of the space bar if your keyboard has two, and release it too. Windows tracks the left and right keys separately, so a stuck key on one side does not show up when you test the other.
- Open Notepad and type a few letters, including L. If your PC locks on L but not on other letters, note that. If other letters misbehave too, the Windows key is almost certainly being held.
Other letters give you a useful clue. With the Windows key held, each letter runs its own shortcut: E opens File Explorer, D shows the desktop, and R opens Run, according to Microsoft's shortcut list. If those happen when you type, a held Windows key is confirmed. If only L misbehaves, suspect a remap or macro that targets L.
Step 2: Test with a different keyboard
Plug in a spare USB keyboard, or use the laptop's built-in keyboard if the problem is on an external one. Then type L a few times.
- The lock stops on the other keyboard. The first keyboard, its software or its switches are at fault. Windows and your settings are fine.
- The lock still happens. The cause is in software on this PC. Continue with Steps 3 to 5.
Step 3: Look for a remap or macro that sends the Windows key
Key-remapping tools can make an ordinary key send a shortcut. Microsoft's PowerToys Keyboard Manager documents this directly: a key can be remapped to a shortcut, so pressing it sends a combination such as Win plus another key. Remaps only work while PowerToys is running with Keyboard Manager enabled. Microsoft's guidance for stopping remaps in a hurry is to close PowerToys or turn Keyboard Manager off in its settings.
To check Keyboard Manager:
- Open PowerToys and select Keyboard Manager.
- Select Remap a key and read every row. Look for a To send value that includes Win.
- Select Remap a shortcut and check that list too, because a shortcut can also be mapped to something that includes the Windows key.
- Delete the suspicious row, or switch Keyboard Manager off, and type L again.
Microsoft's page also says that Win+L cannot itself be remapped, because Windows reserves it. That means you cannot use Keyboard Manager to disable the lock shortcut. You can only remove the thing that sends the Windows key.
Keyboard makers' own software, macro tools and game overlays can do the same job. Close each one you have running, one at a time, and retest after each. Change one thing per test, so you know which one fixed it.
Some keys send a Windows-key combination by design. Microsoft notes that the Office key sends Win+Ctrl+Alt+Shift, and the Copilot key sends Win+C or Left Shift + Windows key + F23. If you have one of those keys and press it by accident next to L, a lock is possible, but that is a one-off rather than a repeating fault.
Step 4: Rule out Sticky Keys
Sticky Keys lets you press modifier keys one after the other instead of together. Microsoft's developer reference describes two states: pressing a modifier once latches it until you press a non-modifier key or click the mouse, and pressing it twice locks it until you press it a third time. The reference names Shift, Ctrl and Alt as the modifiers, and its list of status flags also includes latched and locked states for the left and right Windows keys.
Microsoft's accessibility shortcut page says pressing Shift five times turns Sticky Keys on or off, so the feature can switch on by accident. If it is on and the Windows key is latched, the next key you press, such as L, is combined with it. Check the setting and turn it off if you do not use it, using our guide to turning Sticky Keys on or off.
Microsoft's documentation does not say how often Sticky Keys latches the Windows key in practice, so treat this as a quick elimination step. Filter Keys is a separate accessibility feature, covered in how to turn Filter Keys on or off, and it is a less likely cause.
Step 5: Clean or replace a physically stuck key
If a second keyboard fixes the problem and no software is involved, the Windows key switch may be sticking, or something under the keycap may be holding it partly down. A held key is the most direct way to make L lock the PC every time.
- Press the key firmly several times and see whether it springs back each time.
- On a desktop keyboard, unplug it first and gently clean around the key with a soft brush or a short burst of compressed air.
- On a laptop, do not pry off keycaps without checking how that model's keys come off, since the retaining clips break easily. Contact the manufacturer or a repair shop if cleaning does not help.
A faulty keyboard is cheap to replace on a desktop. If you need a stopgap while you wait for a replacement, the Windows on-screen keyboard lets you type without the physical keys.
Step 6: Restart and update the keyboard driver
If the key tests fine on a second keyboard and nothing remaps it, restart the PC first. A restart clears a hung input program or a modifier state that a program left behind. If the problem comes back, open Device Manager, expand Keyboards, right-click the keyboard and choose Uninstall device, then restart so Windows detects it again. Keep a second keyboard or the on-screen keyboard handy in case a laptop's only keyboard entry is the one you remove.
What the lock does, and how to get back in
Win+L only locks the session. You return to the lock screen, sign in with your usual PIN, password or biometric method, and your programs are still running. Nothing is closed or lost. That is different from the Ctrl+Alt+Del screen: Microsoft describes Ctrl+Alt+Del as opening the security screen, where lock is one of several options. Pressing it does not lock the PC on its own.
If you want the lock shortcut to stop working altogether, that is a Windows policy setting rather than a keyboard fix, and this article does not cover one, because no official Microsoft page was found that documents it for ordinary home PCs. Fixing the held Windows key is the reliable route. Work PCs may have their own policy, so ask your IT team if the lock behaves in ways you cannot explain.
Check that it worked
- Type a full sentence with several L characters in Notepad. The screen should stay unlocked and the L characters should appear.
- Press the Windows key alone and release it. Start should open once and close with Esc.
- Type D, E and R without the Windows key. Nothing should open.
For a longer list of combinations to compare against, see essential Windows and Mac keyboard shortcuts. If the Windows key itself seems dead rather than stuck, our guide to a Windows key that does not work covers that opposite problem.
If it still locks
Go back to the Step 2 result. If a different keyboard also locks on L, something on this PC is sending the Windows key: look at programs that start with Windows and touch input, such as remapping tools, macro software, remote-control tools and gaming overlays. Disable them one at a time, restarting between each test. If a different keyboard does not lock, replace or service the first one.
Frequently asked questions
- What does the Windows key plus L do?
- It locks the computer. Microsoft's shortcut list describes Windows logo key + L as 'Lock the computer' in Windows 11 and 'Lock your PC' in Windows 10. Pressing it takes you to the lock screen without signing you out, and your programs keep running.
- Why does my PC lock when I type the letter L?
- Most likely Windows believes the Windows key is held down while you press L, so the letter is read as Win+L instead of as text. The usual causes are a stuck or faulty Windows key, a remap or macro that sends the Windows key, or a keyboard feature that holds modifier keys. Testing with a different keyboard shows quickly whether the keyboard is the cause.
- Can I remap or change the Win+L shortcut?
- Not with PowerToys. Microsoft's Keyboard Manager documentation says Win+L and Ctrl+Alt+Del cannot be remapped because Windows reserves them. To stop the accidental lock, fix whatever is holding the Windows key rather than trying to change the shortcut.
- Does it only lock when I press L, or other letters too?
- Check other letters. If the Windows key is stuck, other letters trigger their own Windows shortcuts: Win+E opens File Explorer, Win+D shows the desktop and Win+R opens Run. If only L does something, look for a remap or macro that involves L specifically.