Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't input backslash. #104966

Open
hiredtocode opened this issue Aug 19, 2020 · 8 comments
Open

Can't input backslash. #104966

hiredtocode opened this issue Aug 19, 2020 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality keybindings-editor Keybinding editor issues
Milestone

Comments

@hiredtocode
Copy link

hiredtocode commented Aug 19, 2020

Yes.
  • VSCode Version:Version: 1.49.0-insider
  • OS Version: Windows_NT x64 10.0.19041
    Tested with the latest insiders edition --> Yes.

Steps to Reproduce:

Not sure what caused this to happen but I used to be able to type the backslash but all of sudden it stopped working.
Backslash works on any other input areas such as Chrome, windows search or wherever but it doesn't work in VSCode ONLY.
Tried reinstalling VSCode and also the insiders edition. I now have to copy and paste the backslash OR type it by pressing the Alt key + 92 from the num keypad. The pipe sign works without a problem in VSCode. This started with the stable version of VSCode first and when I was about to report this bug I noticed from the report template that I should check with the latest insider's edition and when I first installed the insiders edition it worked but it stopped working again after initial setup (plugins). So as described in the template I tried running with all plugins disabled but problem still exists.
I'm using an American layout keyboard from Corsair K70 MK.2.
Please let me know if I need to provide more information. Thank you.

Does this issue occur when all extensions are disabled?: Yes

@hiredtocode
Copy link
Author

@alexdima Please let me know if you need more information about this bug.

@alexdima alexdima added the windows VS Code on Windows issues label Aug 28, 2020
@alexdima
Copy link
Member

@hiredtocode Can you please try the following:

  1. comment out the content of your keybindings.json (F1 > Preferences: Open Keyboard Shortcuts (JSON))
  2. open a new window (File > New Window)
  3. disable all extensions (F1 > Developer: Reload with Extensions Disabled)
  4. open a new untitled file (File > New File) and try to type in it

@alexdima alexdima added info-needed Issue requires more information from poster editor-input Editor text input labels Aug 28, 2020
@hiredtocode
Copy link
Author

@alexdima Your suggestion works! So, after checking, I went back to my previous window (original window that did not work before your steps) and the backslash worked until I un-commented my keyboard shortcuts but unfortunately I couldn't find the culprit.. I was wondering if you can take a look at my keyboard shortcuts and see what "could" be the cause of this?

// Place your key bindings in this file to override the defaultsauto[]
[
	{
		"key": "ctrl+k",
		"command": "workbench.action.toggleZenMode"
	},
	{
		"key": "ctrl+k z",
		"command": "-workbench.action.toggleZenMode"
	},
	{
		"key": "ctrl+q",
		"command": "-workbench.action.quickOpenView"
	},
	{
		"key": "ctrl+shift+q",
		"command": "-workbench.action.quickOpenNavigatePreviousInViewPicker",
		"when": "inQuickOpen && inViewsPicker"
	},
	{
		"key": "ctrl+q",
		"command": "-workbench.action.quickOpenNavigateNextInViewPicker",
		"when": "inQuickOpen && inViewsPicker"
	},
	{
		"key": "ctrl+k ctrl+q",
		"command": "-workbench.action.navigateToLastEditLocation"
	},
	{
		"key": "ctrl+3",
		"command": "-workbench.action.focusThirdEditorGroup"
	},
	{
		"key": "ctrl+3",
		"command": "turboConsoleLog.displayLogMessage",
		"when": "editorHasSelection"
	},
	{
		"key": "ctrl+alt+l",
		"command": "-turboConsoleLog.displayLogMessage"
	},
	{
		"key": "ctrl+4",
		"command": "turboConsoleLog.deleteAllLogMessages"
	},
	{
		"key": "shift+alt+d",
		"command": "-turboConsoleLog.deleteAllLogMessages"
	},
	{
		"key": "ctrl+4",
		"command": "-workbench.action.focusFourthEditorGroup"
	},
	{
		"key": "shift+f1",
		"command": "editor.action.inspectTMScopes"
	},
	{
		"key": "oem_5",
		"command": "editor.emmet.action.splitJoinTag"
	},
	{
		"key": "ctrl+oem_5",
		"command": "-workbench.action.splitEditor"
	},
	{
		"key": "ctrl+k ctrl+oem_5",
		"command": "-workbench.action.splitEditorOrthogonal"
	},
	{
		"key": "ctrl+shift+5",
		"command": "-workbench.action.terminal.split",
		"when": "terminalFocus"
	},
	{
		"key": "ctrl+r",
		"command": "-workbench.action.openRecent"
	},
	{
		"key": "ctrl+enter",
		"command": "code-runner.run",
		"when": "textInputFocus"
	},
	{
		"key": "ctrl+alt+n",
		"command": "-code-runner.run"
	},
	{
		"key": "ctrl+enter",
		"command": "-editor.action.insertLineAfter",
		"when": "editorTextFocus && !editorReadonly"
	},
	{
		"key": "ctrl+numpad_add",
		"command": "-workbench.action.zoomIn"
	},
	{
		"key": "ctrl+shift+oem_plus",
		"command": "-workbench.action.zoomIn"
	},
	{
		"key": "ctrl+oem_plus",
		"command": "-workbench.action.zoomIn"
	},
	{
		"key": "ctrl+numpad_subtract",
		"command": "-workbench.action.zoomOut"
	},
	{
		"key": "ctrl+shift+oem_minus",
		"command": "-workbench.action.zoomOut"
	},
	{
		"key": "ctrl+oem_minus",
		"command": "-workbench.action.zoomOut"
	},
	{
		"key": "ctrl+e",
		"command": "-workbench.action.quickOpen"
	},
	{
		"key": "ctrl+e",
		"command": "-workbench.action.quickOpenNavigateNextInFilePicker",
		"when": "inFilesPicker && inQuickOpen"
	},
	{
		"key": "f3",
		"command": "quokka.toggle"
	}
]

@hiredtocode
Copy link
Author

hiredtocode commented Aug 28, 2020

@alexdima I think I found the issue here.
I noticed that some commands didn't have any - in front so I added to all of the missing ones and now the backslash works again.

The ones that don't have the - in the beginning of the commands were the ones that I changed shortcut keys before. So basically the ones with the - are the commands that was set in default.

So I guess there's a little bug that don't add - when changing shortcut keys my way so where's what I do usually to change my keys:

F1 > Open Keyboard shortcuts (not the JSON file) > Search for the Command or Keybinding manually > double click on the Keybinding column > press my wanted key combination > hit enter.
Occasionally, I right click and choose Change when expression menu to add under When.

Let me know if you need more details! Thanks again for your work. Much appreciated and I'm soooooo glad to have my backslash back!!

@alexdima
Copy link
Member

@hiredtocode The problem was the following:

{
	"key": "oem_5",
	"command": "editor.emmet.action.splitJoinTag"
},

It is possible that you have changed a keybinding from the UI and instead of choosing Ctrl+\, you inputted only \.

@sandy081 Could we please add a big warning in the keybindings editor when defining a keybinding without a modifier key?

@sandy081
Copy link
Member

Sure I can, but is it for all keys or only for some keys? Does the Fn keys are considered as modifier keys?

@alexdima
Copy link
Member

alexdima commented Aug 31, 2020

@sandy081 IKeybindingService.mightProducePrintableCharacter can be invoked with a keyboard event and that could be used to trigger the warning.

@sandy081 sandy081 added feature-request Request for new features or functionality keybindings-editor Keybinding editor issues and removed editor-input Editor text input info-needed Issue requires more information from poster windows VS Code on Windows issues labels Sep 2, 2020
@sandy081 sandy081 added this to the Backlog milestone Sep 2, 2020
@hardizulhardiyanto
Copy link

Open
Tools > Option > Environment > Keyboard
Set Default and Reset, if your in position Default just click Reset

image_2022-11-16_135117151

@sandy081 sandy081 assigned ulugbekna and unassigned alexdima and sandy081 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality keybindings-editor Keybinding editor issues
Projects
None yet
Development

No branches or pull requests

5 participants