Disable specific keybinding in vscode - visual-studio-code

I ran into a problem with my keyboard lately, my - and = stopped working and I manually remapped the two keys to PgUp and PgDn by editing /usr/share/X11/xkb/keycodes/evdev. Everything works fine but the problem is that vscode still recognizes these two keys as Page-Up and Page-Down while other editors respect my new config. The question is "How do I make vscode adapt to my new configuration"?.
Thanks in advance

I have been able to solve this problem by deleting all the keyboard shortcuts associated with the remapped keys. All I did was opened,
File > Preferences > Keyboard Shortcuts, searched for the word PageUp, right-clicked the matching words and deleted them all. I did same for PageDown and everything works fine now.

Related

Why vscode shortcuts don't work properly?

I've recently updated my VSCode and most of its shortcuts don't work anymore. I tried to reinstall my VSCode but it didn't work. I've checked if it's affected by any other system shortcuts but I wasn't lucky enough and none of them worked for me.
Some shortcuts like:
ctrl + d,
ctrl + shift + k,
etc.
I found a solution for this problem.
go to : File>Preferences>Keyboard Shortcut
Then from upright of the page select the icon that says open keyboard shortcuts. Like below
In the keybindings.json tab you may see something like this:
Replace everything with the settings from the following links:
if you are using windows copy settings from this link: windows.keybindings.json
for mac: macos.keybindings.json
for linux: linux.keybindings.json
and if you want to see all available options see this link: vs-code-default-keybindings
after saving the file, your vscode shortcuts will work properly again.
There could be many reasons. First check that if there is any other application overrides the shortcuts or not.
If there are multiple VS windows, some binded keys are did not work. In my case, everything worked when I closed the windows. Except a one window.

VSCode, Ctrl+Tab does not quick switch editor windows

Strange problem appears on one of my machines.
Hit Ctrl+Tab, just hit and immediate release of Ctrl - should switch to the last used editor window. Should.
But instead I have a drop down with list of editors and have to press Enter to do the actual switch.
Holding Ctrl and hitting Tab several times - acts normal.
The problem I see is on VSCode v1.66.2. Another two machines have the very same version and do not experience that issue. So I am assuming the problem is somewhere in settings but I am at loss which one.
I guess, I had to write the question down to find the answer...
The reason for the problem was in extension. In this case it was "Keyboard Macro Beta". It overrides the default behavior of Ctrl+Tab, for some reason.
Found it by just typing "Ctrl+Tab" in the filter field of Keyboard Shortcuts.
Disable/uninstall the extension and default behavior for the hotkey was restored.

How to get keyboard shortcut `Cmd + S` to save on VS Code?

When I attempt to save my file on Visual Studio Code with the cmd+s keyboard shortcut, it does not save the code. I have to manually click File, the Save, just to be able to save my progress. I'm using macOS Catalina version 10.15.7 and VC Code version 1.55.2.
How do I fix this?
Attempts:
-Checked if ⌘ Cmd + S keyboard shortcut is tied to the Save functionality
If you do it right this solution will fix your issue.
I have never had a problem saving with VS-Code personally, but I have had issues with keybindings. IDK if you write your own keybindings, but if you do, you might want to check the keybindings that you have wrote to make sure they do not conflict with [CTRL + S]. The keybindings.json file that you create custom keybindings in, overrides the default keybindings.json file that defines the keybindings that VS-Code ships with.
To check your keybindings.json file...
Hit the F1-Key
A menu will drop open type in "Keyboard Shortcuts"
There will be two Preferences: Keyboard Shortcuts
Make sure to select Preferences: Keyboard Shortcuts and not Preferences: Default Keyboard Shortcuts
If the file is empty you are good. If you have keybindings written in the file, you need to iterate through them by hand, checking each one. Make sure that none use [CTRL + S] together. Even if the keybinding uses [CTRL + S] and other keys, you will need to disable it, so you can test if it is causing an issue.
Debugging [CTRL + S]
If your keybindings.json file is all good, then great, that's one thing to scratch off the list. The only thing left to do now is debug the Bound Key ("Key Binding"). To debug keybindings, you will use a built in tool, that VS-Code offers. To start do the following:
Hit the F1-Key
When the quick input drops open type the following into the text input:
"Toggle Keyboard Shortcuts Troubleshooting"
Select the option: Developer: Toggle Keyboard Shortcuts Troubleshooting
It should automatically open the OUTPUT panel, which is located in the same panel that your terminal is. Make sure that the OUTPUT is set to LOG(Window) in the drop down. (I took a picture and posted it below if you can't find the Keyboard Shortcut Troubleshooter).
The image might have funny declensions because I am on a dual monitor setup with 1 1080x1920 curved screen and one 1080x720 screen.... I cropped it to a STD HD 1920 width.
I Got My Trouble-shooter working, and Output open, now What Jay?
Okay... Well your at the right spot. Now every-time you press some keys, you should see your OUTPUT WINDOW working like crazy. It should be logging all sorts of stuff, which is good, very good.
This Part Is Important! READ CAREFULLY
What you want to do is use your keybinding that you feel isn't working appropriately. Use it when focus is set on an editor, use it when focus is set on a different editor, use it when focus is set on the sidebar. Where you are focused at in the editor at any given time can greatly affect a keybinding. The output is gonna write lines every-time you use your keybinding. Try not to hit any other keys while doing this, so you have a column in you output that includes logging from the keybinding you are testing only. Read the output see what it says. See if it looks right, or wrong. If it looks wrong, you can visit this link, to the VSCode site that covers this topic, and see if you can fix it your self. If you can't fix it your self, come back here, and edit your question. When you edit your question make sure that it includes the Troubleshooter's Logging Output.
VSCode Troubleshooting Keybindings (Keyboard Shortcuts) # https://code.visualstudio.com/docs/getstarted/keybindings#_troubleshooting-keybindings
Image that shows how to open the Keyboard Debugger
Also shows how to set the OUTPUT to Log(Window)
StackOverflow-2021-JUNE-26018:34-PST
Another thing to check for is, for lack of a better term, combination key bindings. For example, I was having an issue with ⌘+s. VSCode gave a message that it was waiting for the second key binding. After looking at the keybindings.json, I noticed I had a key binding for opening up user snippets as
{
"key": "cmd+s cmd+n",
"command": "workbench.action.openSnippets"
}
The ⌘+s portion of this key binding conflicted with the default ⌘+s

F6 and F8 not working in eclipse [duplicate]

In Eclipse I can only run/debug my project by using one of the menu buttons. Pressing F11 or Ctrl + F11 does nothing. I've mapped Debug Last Launched to all kinds of various keyboard shortcuts to see if another program running in the background was intercepting the key presses and that doesn't seem to be the case. Every other keyboard shortcut seems to work fine such as Ctrl + Shift + T or Ctrl + G.
Any help? The shortcut key works on my other computer and I keep instinctively trying to press it and it's drastically slowing down my work efficiency.
The only solution works for me ;
Open Key mappings (CTRL+SHIFT+L twice)
Find the debugging shorcuts (F5,F6,F7...) and select
then change the When action value from "Debugging" to "In Window"
Go to Window -> Preferences -> General -> Keys
For each key that doesn't work: Set your binding to whatever you want. - I just copy the command then change "When" from "Debugging" to "Editing Java Source".
good luck.
I battled with a new Dell laptop, so in case it saves someone time ....
By default, the F-key priority was set for sound, brightness and music, e.g. F9 brings up Windows search.
--> This is without pressing the Fn key and the desired Fkey as expected.
To toggle the priority, look for Fn + Esc.
That allows F5, F6 etc to work as expected.
You can press Fn + F6 for skipping music tracks
If your computer has a fn lock/toggle that switches between fn and the f1-f12 keys, make sure that you didn't toggle the other mode by accident.
If you use the default key mappings, restoring defaults might work.
Window | Preferences | General | Keys (or Ctrl+Shift+L then L), then hit Restore Defaults and OK.
For custom mappings, I recommend this answer.
Try F11.
It worked for me. Im using Eclipse in ADT.
Please check if another program is trying to hook keyboard messages. Maybe that program prevents the Eclipse to receive some keystrokes including Ctrl + F11.
I had this problem and finally I found out that the problem is about my dictionary application which used Ctrl + F11 to popup. After disabling the hotkey in the dictionary application, Eclipse started to handle Ctrl + F11 correctly!
Edit: My post doesn't directly react the original malfunctioning-F11-behavoir question. But the issue I had seems quite similar and definitely it relates to some other (quite highly voted) answers.
I've bumped into a similar issue too when I upgraded to Eclipse 4.7 Oxygen and needed to install several plugins from a scratch. F* keys didn't work in the debug perspective even though the appropriate key bindings were configured correctly.
Unfortunately, neither reseting perspective nor reseting key bindings (as suggested in some comments here) helped.
The trick that fixed that for me was:
Preferences > Run/Debug > Perspectives > Restore Defaults
That revived the F* keys functionality in my debug perspective. I don't thing this is the universal way how to bring the behaviour back, but among the other "Resets to defaults" this one may be the right one in some cases, so it's worth trying.

Eclipse - Run/Debug shortcut key doesn't work

In Eclipse I can only run/debug my project by using one of the menu buttons. Pressing F11 or Ctrl + F11 does nothing. I've mapped Debug Last Launched to all kinds of various keyboard shortcuts to see if another program running in the background was intercepting the key presses and that doesn't seem to be the case. Every other keyboard shortcut seems to work fine such as Ctrl + Shift + T or Ctrl + G.
Any help? The shortcut key works on my other computer and I keep instinctively trying to press it and it's drastically slowing down my work efficiency.
The only solution works for me ;
Open Key mappings (CTRL+SHIFT+L twice)
Find the debugging shorcuts (F5,F6,F7...) and select
then change the When action value from "Debugging" to "In Window"
Go to Window -> Preferences -> General -> Keys
For each key that doesn't work: Set your binding to whatever you want. - I just copy the command then change "When" from "Debugging" to "Editing Java Source".
good luck.
I battled with a new Dell laptop, so in case it saves someone time ....
By default, the F-key priority was set for sound, brightness and music, e.g. F9 brings up Windows search.
--> This is without pressing the Fn key and the desired Fkey as expected.
To toggle the priority, look for Fn + Esc.
That allows F5, F6 etc to work as expected.
You can press Fn + F6 for skipping music tracks
If your computer has a fn lock/toggle that switches between fn and the f1-f12 keys, make sure that you didn't toggle the other mode by accident.
If you use the default key mappings, restoring defaults might work.
Window | Preferences | General | Keys (or Ctrl+Shift+L then L), then hit Restore Defaults and OK.
For custom mappings, I recommend this answer.
Try F11.
It worked for me. Im using Eclipse in ADT.
Please check if another program is trying to hook keyboard messages. Maybe that program prevents the Eclipse to receive some keystrokes including Ctrl + F11.
I had this problem and finally I found out that the problem is about my dictionary application which used Ctrl + F11 to popup. After disabling the hotkey in the dictionary application, Eclipse started to handle Ctrl + F11 correctly!
Edit: My post doesn't directly react the original malfunctioning-F11-behavoir question. But the issue I had seems quite similar and definitely it relates to some other (quite highly voted) answers.
I've bumped into a similar issue too when I upgraded to Eclipse 4.7 Oxygen and needed to install several plugins from a scratch. F* keys didn't work in the debug perspective even though the appropriate key bindings were configured correctly.
Unfortunately, neither reseting perspective nor reseting key bindings (as suggested in some comments here) helped.
The trick that fixed that for me was:
Preferences > Run/Debug > Perspectives > Restore Defaults
That revived the F* keys functionality in my debug perspective. I don't thing this is the universal way how to bring the behaviour back, but among the other "Resets to defaults" this one may be the right one in some cases, so it's worth trying.