# Editor keyboard shortcuts conflict with some international keyboard layouts

**URL:** <https://meta.discourse.org/t/editor-keyboard-shortcuts-conflict-with-some-international-keyboard-layouts/53969>\
**Category:** Feature\
**Tags:** pr-welcome, keyboard-shortcuts\
**Created:** [8 december 2016 om 17:20 UTC](https://meta.discourse.org/t/editor-keyboard-shortcuts-conflict-with-some-international-keyboard-layouts/53969 "2016-12-08T17:20:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ibnesayeed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ibnesayeed/32/120427_2.png) [@ibnesayeed](https://meta.discourse.org/u/ibnesayeed)\
**Post date:** [9 december 2016 om 01:01 UTC](https://meta.discourse.org/t/editor-keyboard-shortcuts-conflict-with-some-international-keyboard-layouts/53969/3 "2016-12-09T01:01:59Z")

</div>

> [@sam](#):
>
> afaik it is just really hard to get proper access to this information in JavaScript

This is true and the Atom blog I linked in my first post talks about the issue and their solution in details.

> For earlier versions of Atom, it was right about here that everything got really hard. Unfortunately, prior to Chrome 51, no API existed to help us determine that on a particular keyboard layout, a keystroke that looked like an `alt-g` actually inserted a `@` character. In many cases, this misunderstanding caused no harm, but if the character collided with a binding (as was the case with `@` on the Swiss German layout), that binding ended up shadowing the ability to type that character in the editor.

> [@sam](#):
>
> but maybe something changed recently, I don’t know

As that blog post notes:

> With Atom’s upgrade to Electron 1.3, we finally had access to the promised APIs. Two new fields have been added to `KeyboardEvent` objects, a `code` property, which describes the physical key pressed as a human-readable string, and a `key` property, which contains the previously-unavailable information about the actual character typed by the user on the current keyboard layout.

In Chrome 51+, Firefox 23+, IE 9+, and Opera 38+ `KeyboardEvent.key` property is available.

> **[KeyboardEvent: key property - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)**
>
> The KeyboardEvent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the keyboard locale and layout.

Atom blog notes that even this new property was not 100% reliable to fight the ambiguity, so they did some custom solution to get the info from the OS itself which is beyond the scope of Discourse. However, even just considering what is available now would probably solve the issue for Discourse as the key bindings are very limited in the editor as compared to the Atom where every plugin might add a few key bindings. In case of Atom though, these bindings are user customizable, which is not the case with Discourse, so the issue is more severe here.

---

_[View the full topic](https://meta.discourse.org/t/editor-keyboard-shortcuts-conflict-with-some-international-keyboard-layouts/53969)._
