Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Some non-US keyboard layouts not working #37

Closed
nshtg opened this issue Jun 14, 2014 · 77 comments
Closed

Some non-US keyboard layouts not working #37

nshtg opened this issue Jun 14, 2014 · 77 comments

Comments

@nshtg
Copy link

nshtg commented Jun 14, 2014

Regarding: atom/atom#2600
@kevinsawicki

Compare US and (for example)
800px-kb_us-international svg

German keyboard layout
800px-kb_germany svg

I think its easy to see why src/helpers.coffee is destined to fail horribly.

One example to demonstrate: I try to Toggle comments using Ctrl-/. For that I would have to press Ctrl-Shift-7 as you can see above. It registers Ctrl-?.

I don't know how, but your script somehow catches my Ctrl-Shift-7 (which would be shift+55) and makes it an ? (191) where it should make it an &.

Edit: What is that; If I press # on my keyboard it gets resolved to 3 in the keybinding resolver, but inserted correctly into the text. Something is very very wrong here! 😱

@nshtg
Copy link
Author

nshtg commented Jun 14, 2014

Regarding that ChromeBug you told us about; It seems like it is only relevant on keydown (show 191).

keypress returns the correct value 47 for my call! Why are you using keydown in favor of keypress?

@nathansobo
Copy link
Contributor

The keypress event doesn't include modifier key information if I recall correctly.

@nshtg
Copy link
Author

nshtg commented Jun 15, 2014

Ups, I did not mean to delete. Yes indeed keypress supplies the modifier key information but it does not get triggered unless there is a key to insert. For example Ctrl-Shift-7 will not insert anything because it does not press a key - Only Shift-7 does.

But using keydown to map characters (the existing keybindings) to the user input is not really easy or straightforward I think. This guy explains it pretty good:

http://www.javascripter.net/faq/onkeypress.htm

Unlike event.keyCode of keydown/keyup events, the character codes in keypress events reflect the actual characters the user typed (and not necessarily the keys pressed). The characters may be capital or small, Latin or locale-specific. For example, depending on the current state of the client, the F key on the keyboard may produce a capital Latin letter F, a small Latin letter f, a capital Cyrillic letter A, a small Cyrillic letter a, or any other character that might be mapped to this particular key – quite a few different characters with their own character codes. Therefore, we must use the keypress event here; should we use keydown, we would get the same key code 70 (F) for all of the above.

@nathansobo
Copy link
Contributor

So do you see any way of dealing with this other than lobbying Chromium to fix the underlying issues? This stuff gets confusing quickly.

On an international layout, what are the expectations for key bindings. For example, in the Greek layout they expect unmodified keystrokes to insert Greek characters, but they expect keystrokes with modifier keys to fall back to the ASCII equivalents.

@nshtg
Copy link
Author

nshtg commented Jun 18, 2014

@nathansobo
I spent the past days reading through everything on jQuery/javascript key handling that I could find, and no, I think except for lobbying chrome there's nothing we can do. But I don't have too high expectations, I remember another crucial bug that was open for almost 7 years and no one even remotely cared.

@nathansobo
Copy link
Contributor

It's not implemented in Chromium yet, but the DOM Level 3 keyboard event spec should give us exactly what we need with the KeyboardEvent.key property. It's partially implemented in Chromium and is being tracked by this issue. It looks like some of the properties have been implemented but we're still waiting on key.

@nshtg
Copy link
Author

nshtg commented Jun 18, 2014

I saw that, yep. Let's hope they do it in the near future, but there hasn't been activity for almost a year.
😕

@mjrk
Copy link

mjrk commented Nov 25, 2014

Ubuntu 14.04, German keyboard layout, Keybinding resolver "correctly" gave Ctrl+& when I tried to press Ctrl+Shift+7 to toggle comments. It does not work, I have to press Ctrl+# (corresponds to the US layout's '/').

Thanks to the issue it's easy to figure out which keys to use and to understand why "native!" keys work according to my keyboard layout while others don't. If this issue remains open for long (depending on Chromium), I wonder if it's possible to give feedback about the situation in the Settings window - e.g. configuring my native layout and displaying its keystroke in a column next to the current Keystrokes.

@donlencho
Copy link

How is this possible that they ignore there are keyboards out there that are not US keyboards?
This it the type of things that make Atom unusable or at least not fully usable for so many people, isn't there a way to deal with it internally?
Thank you!

@andersennl
Copy link

Regarding the german keyboard layout: maybe this is obvious for some people, but this is only one possible german keyboard layout. At least the german mac keyboard layout is different than the one on the image. I'm not sure if the e.g. US win/mac keyboards differ as well.

@screendriver
Copy link

@andersennl that's true. For example I am using the german Neo2 Layout. Most of the usual characters like = and : and so on are not working in Atom (Mac OS X) 😢

@jannickj
Copy link

I don't know if this is the same bug but I can't unbind the | key. Right now it folds any text tree but I need to use that key for haskell :(

@nathansobo
Copy link
Contributor

@jannickj Can you paste the expression you're using to unbind?

@jannickj
Copy link

@nathansobo thanks, and sorry I didn't update my comment, I found out the correct key to unbind using the atom keybind resolver.

apparently unbinding ctrl-alt-[ did the trick to unbind altgr-|
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-[':'unset!'

@KingTigerXCII
Copy link

KingTigerXCII commented May 18, 2016

Hey, i've got the same problem with the german keyboard layout. Is there any solution for this problem?

Thx

@ccoenen
Copy link

ccoenen commented May 18, 2016

@hellobasti currently there's just workarounds. Much of that discussion is over in #35, basically look for this package and install it: https://atom.io/packages/keyboard-localization it will probably fix the most pressing problems for a german keyboard.

@BramVanroy
Copy link

BramVanroy commented Aug 8, 2016

For me the localization package at #37 (comment) fixed the issue of not being able to type an opening bracket [. Thanks @andischerer! I am using the fr_BE layout. Note that an alias nl_BE would be nice. Quick info: one half of Belgium speaks French, the other Dutch - but we all (mostly) use an azerty (French) keyboard. (Oh, and a couple of folks in the East speak German. I am not sure which layout they'd use!)

@50Wliu
Copy link
Contributor

50Wliu commented Sep 21, 2016

This should be fixed starting with Atom 1.12.0.

@50Wliu 50Wliu closed this as completed Sep 21, 2016
@Albertc
Copy link

Albertc commented Sep 21, 2016

Sorry for my ignorance, I tried to read all lines above.

Can anyone explain what to do to solve the problem than when I type ctrl + / " (for comment a line), Atom receives ctrl + &? and don't comment anything.

What to put and where

Thanks

@ccoenen
Copy link

ccoenen commented Sep 21, 2016

@Albertc

  • short-term solution for most of the keyboard problems is this package: https://atom.io/packages/keyboard-localization for most people it's a "install it and be happy" thing.
  • long-term solution: Soon(tm) Atom 1.12 should be released, it features a big change in this general area. It may also solve your problem without any extra package.

@johan-boule
Copy link

johan-boule commented Oct 2, 2016

I was about to give a try to Atom, but after seeing this issue, I'll wait for a couple more years. Good luck, and see you back in 2018.

@50Wliu
Copy link
Contributor

50Wliu commented Oct 2, 2016

I'll wait for a couple more years.

This issue has already been fixed in Atom 1.12.0 (if you decided to read the issue in its entirety, you would have realized that).

@Tokimon
Copy link

Tokimon commented Oct 2, 2016

Personally I am using a danish layout and I also have the issue of wrong mapping.
Maybe I missed something in the 1000000 comments spread out into almost as many issues, but why is it that Atom doesn't look at the actual input given by the keyboard. I can write the right chars well enough, but it is simply the Key Binding Resolver that detects the wrong keys and executes an unintentinal action as a result.

Right now I am having the problem that I can't write the | char as the Resolver resolves ctrl-alt-| (or altGr-|) into ctrl-alt-[ and that is bound as a shortcut for an action. I will use the unset! technique, but to me that is just a hack to the real underlaying problem, that keystrokes are not resolved as sent from the keyboard.

I have stated this problem in atom/atom#6091 as well.

@50Wliu
Copy link
Contributor

50Wliu commented Oct 2, 2016

@Tokimon As I stated right above you, this issue will be fixed in the upcoming Atom 1.12.0 release.

@johan-boule
Copy link

johan-boule commented Oct 2, 2016

@50Wliu I'm sorry for the sarcasm, and i'm glad for you if you eventually have a new system released a few days ago that eventually get the keyboard handling right (I did read that). However, it's now going to be rather hard for me to believe it's gonna be OK. So, yes this issue did harm atom's reputation, because keyboard handling cannot be an afterthought for a text editor! It should have been a basic requirement for releasing anything from day one.

@ccoenen
Copy link

ccoenen commented Oct 2, 2016

@johan-boule I have called out the atom team on numerous occasions in many of the open issues. I've called them names, I was angry, I pointed fingers at them for "not caring". You know what? It took a while, it certainly took longer than i'd hoped it would, but now it's probably going to be alright.

There were major blockers in the way of getting this one right. This is also information buried in the 1000000 comments. It's fine for the vast majority of cases. Yes, there might be bugs, but the earlier those get found, the earlier they will get squashed. As far as I can tell, beta releases are for 1.11 - so the beta channel does not yet have the mentioned changes.

@alberto
Copy link

alberto commented Oct 10, 2016

Sorry for the spam, but seeing the comments above, I just wanted to leave a huge THANK YOU to the atom team and contributors. You've made an incredible OSS editor and I know a lot of people like me that is grateful for that, even if we are quiet. ❤️

@hildersantos
Copy link

Sorry to "reopen" this issue, but... I'm on Atom 1.2.5, and the US International keyboard layout is not working for some keys. I'd already tried on a fresh Atom install, and on safe mode, without success. Even the keybinding-resolver is not showing the correct shortcut (i.e. the ^ accent, so essential to vim mode).

It was working very well on 1.2. I made a clean OS install and after reinstalled Atom, this issue just popped out.

nov-26-2016 13-42-27

Is there anything I should enable?

Thanks!

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Nov 26, 2016

@hildersantos Please open a new issue for this bug, thanks.

@selrond
Copy link

selrond commented Sep 18, 2017

Things are not working for me either.

I'm on MB Pro with macOS Sierra 10.12.6 (16G29)
Keyboard: Slovak QWERTZ
Atom version: 1.20.0

When I press cmd+' (as recognized in Sublime Text), Atom sees ctrl+§. Or cmd+/ (toggles comment in Sublime Text), Atom sees cmd+'.

Weird enough, macOS' native Keyboard viewer shows expected keys when typed, just Atom and VSCode seems to interpret them wrongly.
I suspect Electron has something to do with it...

I've already spent about 2 hours trying to resolve the issue, but I'm starting to lose my mind...

Any suggestions?

@ccoenen
Copy link

ccoenen commented Sep 18, 2017

I think your chances are better opening a new ticket. You can of course link here if anything in this lengthy discussion helps understanding or fixing your issue.

@johan-boule
Copy link

Does it work on vi or emacs ? That may be an alternative.

@metemaddar
Copy link

This problem is still present I think.
My Locale is Persian. and the key bindings "Ctrl+C"/"Ctrl+V"/"Crtl+/" Don't work in Persian keyboard. It would be appreciated if it could be solved.
Thanks

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Feb 28, 2018

@metemaddar Please open a new issue and fill out the entire issue template so we can take a look, thanks 🙇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests