atom / atom-keymap

Atom's selector-based keymap system
MIT License
105 stars 57 forks source link

Set different keyboard locale (not the system wide) in Atom on Windows 7 #191

Closed ajtb closed 7 years ago

ajtb commented 7 years ago

Hi, I know keyboard localization is fixed, but from what I can understand, on Windows 7 Atom uses the system language to determine keyboard layout. I am using Windows 7 in English, but wit Polish (pl_PL) keyboard layout.

Atom does not recognize AltGr+z, which should produce "ż". I don't have this problem in other programs. Because of that, I'm wondering if it's possible to set a custom local keyboard layout in Atom? Or is there any kind of workaround I can use?

Ben3eeE commented 7 years ago

This is because AltGr-z is bound to editor:checkout-head-revision. We have started to remove AltGr keybindings from core starting with Atom 1.12 and will be continued in Atom 1.13, the keybind for editor:checkout-head-revision was removed in 1.13.0-beta4.

If you want to be able to write this character in Atom 1.12 using AltGr-z you will have to change the keybind yourself in your keymap.cson (File menu -> Keymap...) and add the following:

'atom-workspace atom-text-editor:not([mini])':
  'ctrl-alt-z': 'unset!'

Sorry for the inconvenience.

ajtb commented 7 years ago

Great, thanks for your help!

ajtb commented 7 years ago

One last thing: this does not seem to work for AltGr+O. 'ctrl-alt-o': 'unset!' does nothing, unfortunately. I guess I'll try the beta for now.

Ben3eeE commented 7 years ago

I believe you need to use a different selector for AltGr+o. You can try this:

'body':
  'ctrl-alt-o': 'unset!'

In the beta this is changed to Ctrl-Shift-O to avoid conflict with the AltGr variants.

ajtb commented 7 years ago

I get an error, "failed to load keymap"

[stdin]:53:10: error: unexpected newline
  'body':
         ^

I had it for the first solution, but changed it to ".platform-win32 atom-text-editor:not([mini])": This helped, for "z", but does nothing for "o". The solution is right around the corner, so I guess I'll wait or use beta. Thanks again for the tip :)