Sublime Forum

Sublime Text 3 overriding crucial keys in my keyboard layout

#1

Hi,

Since switching to sublime text 3, it has been impossible for me to unbind some commands which clash with my keyboard’s layout.

Here’s an example of a crucial key that has been disabled:

Ampersands (&) are made by pressing altgr+P on my keyboard layout (bépo).

There is a pre-bound command to that key combo in ST3: « { “keys”: “ctrl+alt+p”], “command”: “prompt_select_workspace” }, »

I have tried to disable it by entering the following line in my user keymap: « { “keys”: “ctrl+alt+p”], “command”: “unbound” } ». The command is now disabled and I do not see the prompt anymore when using altgr+P. However, I can not type ampersands in sublime text using altgr+P. It does nothing at all. It used to work in Sublime Text 2 by just removing the shortcut line from the global keymap, which I can’t do anymore in Sublime Text 3.

I also tried to bind the “prompt_select_workspace” command to something else, but it does not unbind it from altgr+P and instead ends up having two working shortcuts.

TLDR Summary: I want to unbind a key so that it does what it’s meant to do on my keyboard layout, but can’t in ST3.

The following really important keys are not working anymore for me due to this problem: Ampersand (&), tilde (~), underscore (_). You can imagine how this impairs my coding ability. For now, I have switched back to Sublime Text 2, and hope to find a solution to this issue.

Thanks in advance for the help.

Eric B.

2 Likes

Getting SublimeText back to respecting my system wide hotkeys
Is possible to package override a Sublime Text Default keybinding?
#2

If it helps anyone, I found a temporary solution by searching in the documentation. Here’s my working key binding for ampersands:

I’d really like it if there was a simpler, more logical way to simply get rid of a shortcut instead of having to override it like that.

Eric B.

0 Likes

#3

I’ve got exactly the same critical problem, since I use bepo.fr/ layout too.
I’m pairing with people using azerty and qwerty layouts (switching quickly the layout with a shortcut), so I too would prefer to really unbound the command instead of mimicking bépo behavior.

Thanks,

Guillaume C.

0 Likes

#4

You can try overriding the package file to remove the keybinding you want. For the sake of simplicity, you can use PackageResourceViewer. Simply open Default/Default (your platform).sublime-keymap. Then remove the entry you want and save. It will create the file in the correct location for the “override” behavior.

2 Likes

[Solved] How to automatically set file back to read-only after saving?
#5

Thank you, PackageResourceViewer worked perfectly.

2 Likes

#6

You may use this http://stackoverflow.com/a/37060993/4934640 to disable any key from any package.
It is good because is update proof. For the default keys, create a package within the same name as the default package keys, removing the keys you do not want to.
Example, create a folder on \Packages\Default\Default (Windows).sublime-keymap (the same forder where your \Packages\User folder settings is, the one you go by Preferences -> Browse Packages...), where its contents are the same the default windows keys, except the keyboard shortcuts you do not want to.

0 Likes

Adding folder pointers to default .sublime-build files (Sublime Text 3, c++)
[Solved] How to add/remove a default menu entry when a X package is/isn't enabled/installed?
How to redefine some default keys?
Edit tmTheme in Sublime Text 3 Build 3126 for <key>lineHighlight</key>
Edit tmTheme in Sublime Text 3 Build 3126 for <key>lineHighlight</key>
#7

I tried that on LInux, but it seems like “ctrl+alt” is not the same as “AltGr” on linux. Is her a way to make this work?

I want to add the vim movements to Sublime on altGr, so I added this to my key bindings:

{ "keys": ["ctrl+alt+h"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": ["ctrl+alt+l"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": ["ctrl+alt+k"], "command": "move", "args": {"by": "lines", "forward": false} },
{ "keys": ["ctrl+alt+j"], "command": "move", "args": {"by": "lines", "forward": true} },

which works fine with the real combination of ctrl + alt and the letters, but not with AltGr

0 Likes