Repository: vscode
Issue: Ctrl+# not being detected
Labels: bug,keybindings


Type: <b>Bug</b>

I have Azure CLI Tools installed with a keybinding to run the current line as Ctrl+#. When pressed, nothing happens.
Keyboard Shortcut Troubleshooting detects this key combination as only Ctrl. Trying Alt+# detects the combination but resolves # as '. If I press # by itself, it also resolves as ' - which on a UK keyboard is the key to the left of it.
In an editor, pressing # correctly displayed the hash symbol.

Pressing # only:

```
2023-07-06 16:46:00.419 [info] [KeybindingService]: / Soft dispatching keyboard event
2023-07-06 16:46:00.419 [info] [KeybindingService]: | Resolving '
2023-07-06 16:46:00.419 [info] [KeybindingService]: \ No keybinding entries.
2023-07-06 16:46:00.419 [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: Backslash, keyCode: 222, key: #
2023-07-06 16:46:00.419 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: Backslash, keyCode: 95 (''')
2023-07-06 16:46:00.420 [info] [KeybindingService]: | Resolving '
2023-07-06 16:46:00.420 [info] [KeybindingService]: \ No keybinding entries.
```

Pressing Alt+#:

```
2023-07-06 16:47:53.183 [info] [KeybindingService]: / Soft dispatching keyboard event
2023-07-06 16:47:53.183 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2023-07-06 16:47:53.184 [info] [KeybindingService]: / Received  keydown event - modifiers: [alt], code: AltLeft, keyCode: 18, key: Alt
2023-07-06 16:47:53.184 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: AltLeft, keyCode: 6 ('Alt')
2023-07-06 16:47:53.184 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2023-07-06 16:47:53.318 [info] [KeybindingService]: / Soft dispatching keyboard event
2023-07-06 16:47:53.319 [info] [KeybindingService]: | Resolving alt+'
2023-07-06 16:47:53.319 [info] [KeybindingService]: \ No keybinding entries.
2023-07-06 16:47:53.319 [info] [KeybindingService]: / Received  keydown event - modifiers: [alt], code: Backslash, keyCode: 222, key: #
2023-07-06 16:47:53.319 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: Backslash, keyCode: 95 (''')
2023-07-06 16:47:53.319 [info] [KeybindingService]: | Resolving alt+'
2023-07-06 16:47:53.319 [info] [KeybindingService]: \ No keybinding entries.
2023-07-06 16:47:53.526 [info] [KeybindingService]: + Ignoring single modifier alt due to it being pressed together with other keys.
```

Pressing Ctrl+#:

```
2023-07-06 16:48:11.570 [info] [KeybindingService]: / Soft dispatching keyboard event
2023-07-06 16:48:11.588 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2023-07-06 16:48:11.588 [info] [KeybindingService]: / Received  keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
2023-07-06 16:48:11.588 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl')
2023-07-06 16:48:11.588 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2023-07-06 16:48:12.021 [info] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.
```

Changing the binding to something else works, but then from Keyboard Shortcuts I am unable to press the Ctrl+# combination to set it back.

VS Code version: Code 1.79.2 (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:57:04.379Z)
OS version: Windows_NT x64 10.0.22621
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 3900XT 12-Core Processor            (24 x 3793)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|63.91GB (47.96GB free)|
|Process Argv|--enable-extensions --crash-reporter-id 0c36aba9-0485-4a7d-ad1b-51bd7feafa95|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (32)</summary>

Extension|Author (truncated)|Version
---|---|---
rest-client|hum|0.25.1
vscode-ansi|ili|1.1.6
azure-pipelines|ms-|1.208.0
azure-dev|ms-|0.6.0
vscode-azurecontainerapps|ms-|0.5.1
vscode-azurefunctions|ms-|1.11.0
vscode-azureresourcegroups|ms-|0.7.5
vscode-azurestaticwebapps|ms-|0.12.2
vscode-azurestorage|ms-|0.15.3
vscode-azurevirtualmachines|ms-|0.6.5
vscode-bicep|ms-|0.18.4
vscode-cosmosdb|ms-|0.19.4
vscode-docker|ms-|1.25.2
csdevkit|ms-|0.1.103
csharp|ms-|2.0.248
vscode-dotnet-runtime|ms-|1.6.0
vscodeintellicode-csharp|ms-|0.1.26
vscode-aks-tools|ms-|1.3.12
vscode-kubernetes-tools|ms-|1.3.13
playwright|ms-|1.0.13
remote-containers|ms-|0.295.0
remote-ssh|ms-|0.102.0
remote-ssh-edit|ms-|0.86.0
remote-wsl|ms-|0.79.5
azure-account|ms-|0.11.5
azurecli|ms-|0.5.0
powershell|ms-|2023.6.0
remote-explorer|ms-|0.4.0
vscode-node-azure-pack|ms-|1.2.0
azurerm-vscode-tools|msa|0.15.10
vscode-yaml|red|1.13.0
save-as-root|yy0|1.6.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30776702
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
pythongtdpath:30769146
bgfeh915:30780428
pythonnosmt12:30779714
pythonidxpt:30772539
pythonnocebcf:30776496
cmakestatusbarv2:30779594

```

</details>

<!-- generated by issue reporter -->