5

In my init file, I have C-) bound to a smartparens "slurp" command. This works great on linux, but when I try to use the same keybinding on my Windows machine, nothing happens.

To troubleshoot on my Windows machine, I've tried C-h c followed by C-)—emacs doesn't register that any keys have been hit.

I've tried a couple of similar key sequences: M-) and C-0 both register fine.

Any idea why C-) doesn't register, and any idea how to fix it?

achalk
  • 579
  • 4
  • 16
  • First, does it happen with no init file (emacs -Q)? Second, does windows use C-) for something else, which prevents it from reaching emacs? – Dan Jan 28 '17 at 00:21
  • Are you using the GUI version of emacs? –  Jan 28 '17 at 00:34
  • @Dan, it happens with no init file. I looked at a page of [windows shortcuts here](https://support.microsoft.com/en-us/help/126449/keyboard-shortcuts-for-windows), and C-) isn't on the list. – achalk Jan 28 '17 at 01:00
  • @DoMiNeLa10, yes I'm using the GUI version. – achalk Jan 28 '17 at 01:01
  • Please show your code that binds the key sequence. Provide a step-by-step recipe that starts from `emacs -Q` (no init file). – Drew Jan 28 '17 at 01:33
  • Hi @Drew, On linux I can just do the following: 1. `emacs -Q` 2. Run `eval-last-sexp` on `(global-set-key (kbd "C-)") 'execute-command))` It then works great. If I do that on Windows, nothing happens. The code evaluates fine, but either Windows or Emacs can't see the `C-)` key sequence when those keys are pressed. – achalk Jan 28 '17 at 01:49
  • I see. Sorry, but I don't have an answer. I see the same thing, and I haven't been able to find info about it. The key is definitely bound in the keymap, but it seems that it is not being sent by the keyboard. – Drew Jan 28 '17 at 16:40

1 Answers1

5

I found a solution—the following works for me:
Control Panel >
Language >
Advanced Settings >
Change language bar hot keys >
Ensure Between input languages is highlighted >
Change Key Sequence... >
Change Switch Keyboard Layout from Ctrl + Shift to Not Assigned.

A similar process is outlined here.

achalk
  • 579
  • 4
  • 16
  • 2
    I had this issue even though I had done these steps in the past. Something must have gotten messed up in Windows because I had to add the key binding back and then remove it to get C-) working again. Oddly C-( worked, but C-) didn't. – Tanj Apr 20 '21 at 17:58
  • @Tanj have the same issue here... – shelper Nov 13 '21 at 15:16