[Claude Desktop / Windows] Enter key permanently switches to newline when WH_KEYBOARD_LL hook is installed

Resolved 💬 3 comments Opened Mar 14, 2026 by ErrPD Closed Mar 17, 2026

Environment

  • OS: Windows 11 Home 10.0.26200
  • Claude Desktop: Latest (Windows Store)

Description

Installing a WH_KEYBOARD_LL (low-level keyboard hook) causes Claude Desktop's Enter key to permanently switch from "send" to "newline". Persists after the hook is removed and after app restart. Only account logout/login resets it.

Minimal Reproduction

import ctypes, ctypes.wintypes, threading

user32 = ctypes.windll.user32

def hook_proc(nCode, wParam, lParam):
    return user32.CallNextHookEx(None, nCode, wParam, lParam)

HOOKPROC = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int,
                            ctypes.wintypes.WPARAM, ctypes.wintypes.LPARAM)
callback = HOOKPROC(hook_proc)

def run_hook():
    user32.SetWindowsHookExW(13, callback, None, 0)  # WH_KEYBOARD_LL = 13
    msg = ctypes.wintypes.MSG()
    while user32.GetMessageW(ctypes.byref(msg), None, 0, 0):
        pass

threading.Thread(target=run_hook, daemon=True).start()
input("Hook installed. Test Claude Desktop Enter key now...")
  1. Open Claude Desktop — Enter sends normally
  2. Run script above
  3. Switch to Claude Desktop — Enter now inserts newline
  4. Stop the script — still broken
  5. Restart Claude Desktop — still broken
  6. Only fix: logout → login

Notes

  • Hook does nothing except CallNextHookEx (pure passthrough, no suppression)
  • Chrome, VS Code, Notepad — all unaffected
  • Claude web (browser) — unaffected
  • Claude Desktop only

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗