Sublime Forum

I can't type the # key

#1

Hello, I try your editor for my arduino project.
It’s look great, but I have a big problem. I can’t type the key # ( like in #include )
I have a french keyboard (azerty)
For type the # character , I type “Atl Gr” + key “3” without other.
Under Sublime text, I obtaint a box with the list of my HD drive !

For type # , I must do a cut and paste with an existant “#”
I try to understand the key-binding , but it’s look too complicated for me.
If you can give me a line to add or delete in the good conf file, it’s will be great .
Thank for all and apologize for my poor and strange english ( I’m a frog eater :smile:) )

config: WIN7 32bits french
Sublime text build 3065

0 Likes

#2

I don’t know why you’re seeing “a box with the list of my HD drive” when you type “AltGr+3”, but “Alt+3” in ST is the keyboard shortcut to switch to the third open file (as part of an “Alt+n” series). You can prevent this behaviour and allow a “#” to be typed if you block the command in your user key bindings. Open “Preferences > Key Bindings - User” and add:

{"keys": "alt+3"], "command": "noop"}

If you have other key bindings already in that file then make sure you add a comma to the end of the previous line. If the file is empty then you will need to enclose the binding in square brackets:


   {"keys": "alt+3"], "command": "noop"}
]

You might have to add similar key bindings to be able to type the “{”, “”, etc characters.

0 Likes

#3

Nothing good !

before make the add in file like you write I have now :

two copy of my screen
kotec.fr/image1.jpg
kotec.fr/image2.jpg

it look like key alt+3 make a call to plugin_host.exe ???

if I rename plugin_host.exe with an other name, I have a warning at load of ST, but the key altGr+3 do nothing.

No call to a pluging, no echo on screen; anything.
All other text editor or IDE work with this key …?
info: the key altGr+4 give {} and altGr+5 give ] : it’s OK
Thank for your help
Bye

0 Likes

#4

Here’s a pertinent forum discussion on the subject:

“Sublime Text 3 overriding crucial keys in my keyboard layout”
sublimetext.com/forum/viewtopic.php?f=3&t=13303

So you will need to add a command to enter a “#” character, instead of just blocking the native command. Try adding this to your “Preferences > Key Bindings - User” file (instead of my previous suggestion):

{"keys": "alt+3"], "command": "insert", "args": {"characters": "#"}}

If that does not work then a plugin might be stealing the AltGr+3 key binding. To test this, rename plugin_host.exe back to “plugin_host.exe”, remove (or comment) my suggested key binding from your user key bindings file, open the ST console (View > Show Console), and type:

sublime.log_commands(True)

Then try the “AltGr+3” keyboard shortcut and check what command is recorded in the console.

Alternatively you can try a fresh install and see if that fixes it:

sublimetext.com/docs/3/revert.html

0 Likes

#5

I try this in default key map file

{ "keys": "²"], "command": "insert", "args": {"characters": "#"} },
this command is OK , I must type the little two for have "#"  ==> no problems
 the "²" key is locate at left of "1" key 

this command :
{ “keys”: “AltGr+3”], “command”: “insert”, “args”: {“characters”: “#”} },
no work and the altgr+3 key give allways the box like image2.jpg
I try with ST v2 and V3, it’s the same problem.

I think the keyword “AltGr” is not good !

If I delete the “Arduino-like IDE” package , everything become normal ( altgr+3 give me a # )
if I re-install the “Arduino-like IDE” package , the bug come back immediatly.
It’s good for me with the ² key.

you can close the subject
Thank you for all
Kotec le Gris
Bye

1 Like

#6

Glad to hear that you found a workaround. Perhaps you can post an issue or a feature request at the plugin site.

ST3 reportedly sees the AltGr key as a regular Alt (Ctrl+Alt in ST2), so you would have to use just “alt+3” in the key bindings. I doubt that ST would accept “AltGr” in a key binding, and in any case key bindings must be lowercase (as far as I know).

Here’s a forum post explaining the issue, in case you’re curious:

“AltGr being recognized as Alt”
sublimetext.com/forum/viewtopic.php?f=3&t=14438

0 Likes

#7

I just see that the Arduino package overload and remap a lot of keys.

ctlr+alt +1 , +2 and +3 are remapped for configuration of folders of arduino environment.
ST 2 and 3 are not bugging with these keys.
I keep ST for my dev under Arduino and Itry to patch the package …
Bye

0 Likes