SeanArchibald / scale-workshop

Design microtonal scales and play them in your web browser. Export your scales for use with VST instruments. Convert Scala files to various tuning formats.
https://sevish.com/scaleworkshop/
146 stars 23 forks source link

Make keyboard layouts easier to find #123

Open Sogolumbo opened 3 years ago

Sogolumbo commented 3 years ago

Edit: Already implemented but slightly unintuitive to find, see comments below.

Problem

Currently a Querty layout is assumed to convert the input into notes. This leads to wrong notes or no notes being played on different keyboard layouts.

It would be nice if other language specific layouts would also work.

Possible solution

Detect the language and default to the most popular layout from that language to do the conversion. Maybe it's also possible to get the layout directly from the browser, I don't know.

Workaround

Change the system keyboard layout to querty. This will not always make all keys work but it will fix the z/y in qwertz layouts.

To make the workaround more viable (if a proper solution won't be implemented): Detect the language and inform the user about the keyboard layout if the most popular layout from their language is not querty.

meszaros-lajos-gyorgy commented 3 years ago

Hi!

There are already a few alternative keyboard layouts added to scale workshop that might solve the issue for you. There is a panel on the right hand side of the app labelled Isomorphic keyboard settings, where you can select a different layout via the Computer keyboard layout dropdown.

If the only issue with the current layout is that Z and Y is flipped, then Hungarian (QWERTZ) will solve exactly that.

Sogolumbo commented 3 years ago

Thanks! I didn't see that. That's exactly the kind of thing I was looking for. I didn't search at that spot because I didn't think I wanted to do something "isomorphic" (although the term may be technically correct). I guess I didn't even fully process the meaning of that word and skipped the rest of the menu title. Maybe it would make sense to rename that menu to just "keyboard settings". Also it says

Press QWERTY keys to play current tuning.

at the top. Maybe it would make sense to add some note there to inform people that querty is not the only option (because that's the conclusion I drew from this sentence. I thought if there's no possibility to change the keyboard layout where it's mentioned anyways then I don't have to look anywhere else.

Azorlogh commented 3 years ago

The deeper issue here is that the keyboard handling code uses the KeyboardEvent.which property (which by the way is the obsolete, KeyboardEvent.key is the new name for it). Instead, it should use the KeyboardEvent.code, which is independent of the layout.

meszaros-lajos-gyorgy commented 3 years ago

I guess it sounds logical to link here the other keyboard related ticket: https://github.com/SeanArchibald/scale-workshop/issues/31