Sublime Forum

Neo keyboard layout not full supported

#1

Hi, I want to use sublime2 but my keyboard layout is not full supported.

I use Neo2-de on a Debian squeeze.
The main problem is that the directions keys on the left hand are do nothing.

In Neo2 there is a “Mod4” key witch is in the default German keyboard layout the “<” key. If this key is compressed there are direction keys on: e – forward, d – back, f – right, s – left (in the default German keyboard layout).

wiki.neo-layout.org/wiki/Grafiken

My hope is that you can fix it or there is some adon or so that I have not found.

Kind regards

0 Likes

#2

I have the same problem.
German neo layout, got to sublimetext (over humblebundle due to oxeye games studio using your editor (seen in a livestream)).
My return key is mapped on right-alt + p (on english layout right-alt + v) and backspace is right-alt + v (right-alt + w).
I never use the regular backspace, return, movement, delete, page up/down, home, end keys, on some computers I have no mapping for them at all.

So do I :smile:

greetings
/ker

0 Likes

#3

I have the same problem. Hopefully another post helps to make the problem more present. :wink:

0 Likes

#4

You can run the following in the sublime console and you see what key presses Sublime Text gets and modify your user key bindings to do what you want:

sublime.log_input(True)
0 Likes

#5

It seems that Sublime Text doesn’t get always full key bindings. If I type an upper case N it shows me ‘N’ and not ‘shift+n’. Maybe this is a problem of Neo layout and not of Sublime Text.

0 Likes

#6

Upvote at: sublimetext.userecho.com/topic/1 … rd-layout/

It’s a pity that sublime is not open source, thus the chances are low that this will ever be fixed. But we can hope…

0 Likes

#7

Hey fellow Neo-Users,

I share with you my little workaround for the - in my opinion - most important functions of Layer 4. Maybe new Users like me might appreciate this.
Under Linux I use my AltGr as Super_R:

xmodmap -e 'keycode 108 = Super_R NoSymbol Super_R'

Now these keybindings emulate moving and deleting with Layer 4 of the Neo-Layout:

{ "keys": "super+l"], "command": "move", "args": {"by": "lines", "forward": false} },
{ "keys": "super+a"], "command": "move", "args": {"by": "lines", "forward": true} },
{ "keys": "super+i"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": "super+e"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": "super+o"], "command": "move_to", "args": {"to": "eol"}, "extend": false },
{ "keys": "super+u"], "command": "move_to", "args": {"to": "bol"}, "extend": false },
{ "keys": "super+v"], "command": "left_delete" },
{ "keys": "super+c"], "command": "right_delete" }

To make Neo work again in other applications, you have to reset AltGr:

xmodmap -e 'keycode 108 = ISO_Level5_Shift NoSymbol ISO_Level5_Shift'

For now I have a little script to toggle between these two bound to a hotkey, I might write a Gnome-Shell-Extension that executes it on Focus of Sublime windows when I’m in the mood to get into the APIs of Gnome. With WMs like awesome you should also be able to easily accomplish this.

0 Likes

#8

I just want to say, that I also hope this will be fixed. In case this thread will be read by a sublime developer, here are instructions to test support for the neo layout.

in a linux shell write

setxkbmap de neo

now your layout is set to this http://www.neo-layout.org/. Layer 4 is not working. Right Mod4 is right alt, left Mod4 is not available on english layouts. Right Alt+(E/D/S/F) should move the cursor.

just in case you get lost in neo copy this to get back to normal :wink:

setxkbmap us
0 Likes

#9

Please take care of that!

I’m using neo as well and I’m not sure if sublime without 4th layer of neo is faster for me than e.g. gedit.

Any other workarounds?

0 Likes

#10

+1 for fixing this, dear developer! I’m affected as well.

Warm regards,
Stefan

0 Likes

#11

Thank for your tip,

my cursor down key is failing on my laptop, so I was in despair.
My laptop seams to be mapped differently, but with the tip from above what actually arrives at sublime, I saw AltGr comes in as Alt,
so for me

{ "keys": "alt+l"], "command": "move", "args": {"by": "lines", "forward": false} },
{ "keys": "alt+a"], "command": "move", "args": {"by": "lines", "forward": true} },
{ "keys": "alt+i"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": "alt+e"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": "alt+o"], "command": "move_to", "args": {"to": "eol"}, "extend": false },
{ "keys": "alt+u"], "command": "move_to", "args": {"to": "bol"}, "extend": false },
{ "keys": "alt+v"], "command": "left_delete" },
{ "keys": "alt+c"], "command": "right_delete" }

work nicely. Thanks for saving my day, or even better my laptop!

Warm regards,
Stefan

0 Likes

#12

This has been a major PITA. I had a lot of trouble getting this to work without any disadvantages.

Thanks to the people posting solutions.

My solution is a little different. Once setup, it requires no script or constant manual changing of layouts:
(works on Ubuntu/Mint)

  1. In Ubuntu/Mint (maybe in other distros as well) you can activate the feature that different applications can have different keyboard layouts. Activate it (Regional Settings -> Keyboard Layouts: Allow different layouts for individual windows)

  2. Copy the NEO Keyboard layout. I have overwritten the “German Macintosh” one, because creating a new one was too much hassle for me. I recommend doing that. You can overwrite any existing, unused one. Choose one that’s in the de file. This is what you do: go to usr/share/x11/xkb/symbols, open the folder as root. Open the “de” text file. Delete the “German Macintosh” Layout (obviously make backup of file before you edit it), then copy the whole Neo Portion and rename xkb_symbols “neo base” to xkb_symbols “mac_base” and rename xkb_symbols “neo” to xkb_symbols “mac” and include “de(neo_base)” to include “de(mac_base)” and name[Group1]= “German Neo 2” to name[Group1]= “German (Macintosh)”.

  3. add this after the includes:
    key { Alt_L, Alt_L, Alt_L, Alt_L, Alt_L, Alt_L, Alt_L, NoSymbol ] };
    this will bind your AltGr to Left Alt. I prefer this to binding it to Windows key / Super_L, because Super_L + P is hardcoded to be the shortcut for changing display options (external display, clone display, etc). And I use the Neo Level4 with P for Return / new line a lot.

  4. Add the German Macintosh keyboard Layout. You might need to deactivate Layout Change keys in the German Neo 2 Layout Options, if you have a problem with Capslock now.

  5. Open Sublime Text, click on your keyboard layout icon in taskbar and choose “German (Macintosh)”. Sublime will now always use this keyboard layout.

  6. If you want the AltGr+P = Enter Functionality, do this: In Sublime: Put text input cursor anywhere, start recording a macro, press enter, stop recording a macro, save macro as “newline.sublime-macro”

  7. And finally the sublime user keymaps, as already posted, but with alt instead of Super and with the alt+p macro:

    { “keys”: “alt+l”], “command”: “move”, “args”: {“by”: “lines”, “forward”: false} },
    { “keys”: “alt+a”], “command”: “move”, “args”: {“by”: “lines”, “forward”: true} },
    { “keys”: “alt+i”], “command”: “move”, “args”: {“by”: “characters”, “forward”: false} },
    { “keys”: “alt+e”], “command”: “move”, “args”: {“by”: “characters”, “forward”: true} },
    { “keys”: “alt+o”], “command”: “move_to”, “args”: {“to”: “eol”}, “extend”: false },
    { “keys”: “alt+u”], “command”: “move_to”, “args”: {“to”: “bol”}, “extend”: false },
    { “keys”: “alt+v”], “command”: “left_delete” },
    { “keys”: “alt+c”], “command”: “right_delete” },
    { “keys”: “alt+p”], “command”: “run_macro_file”, “args”: {“file”: “Packages/User/newline.sublime-macro”} }
    ]

Now obviously, ALT has been partially rebinded. Though i never use the ALT key to access the menu, so it’s not a problem for me. If you do though, that might be a problem.

Let me know if it works for you or if you find a better, easier way.
Hopefully this will be fixed in Sublime Text, soon…

0 Likes

#13

Thanks for sharing your solution fabyeah.

What is the problem with mapping LSGT to ALT_L in usr/share/X11/xkb/symbols/de ?
Judging by the prior discussion it would not work but why?

Do you have to restart to activate changes in this file?

0 Likes

#14

Affected as well.

We are a small but strong little village in the Middle of all these querties.
Dont give it up Neo2 Guys, our time will come :smile:

btw, love the combination of fast (neo2) and cool (sublime)!

0 Likes

#15

Hi, please fix this issue - it is really annoying not being able to use movement keys and the likes. This does not occur in other applications, so it is a Sublime issue.
Thanks! :slightly_smiling:

0 Likes

#16

I created a fully working fix that needs no remapping:

This is a GTK module that hooks into the gtk key events and modifies them, so that the (faulty) sublime key interpretation logic gets it right.

Usage is very simple. You only need to start sublime with a modified environment variable:
GTK_MODULES=gtkneofix-gtk-module:$GTK_MODULES sublime_text
instead of
sublime_text

0 Likes