h-be / acorn-ui

the user interface for Acorn app, see acorn-hc for backend, acorn-releases for the end-user Application!
Other
8 stars 2 forks source link

Card creation issue #127

Closed bierlingm closed 4 years ago

bierlingm commented 4 years ago

Holding "g" and left-clicking to create a card doesn't work

Connoropolous commented 4 years ago

Hey @bierlingm,

Which OS are you using?

Connoropolous commented 4 years ago

Do you at least get the little pop-up form to create a card, or is that the part that doesn't work? Nothing at all happens?

bierlingm commented 4 years ago

So, apparently it's an issue with input detection. I use the Dvorak layout and pressing the button for "g", actually "u" on the physical keyboard, doesn't allow me to create a card. But pressing the physical key "g", which is "i" in Dvorak, allows me to actually create a card.

So my assumption is that it ignores input from keyboard layouts other than the standard physical keyboard.

Connoropolous commented 4 years ago

Oh gotcha! That's reaallly good and useful feedback.

As a dvorak user, what are your general expectations with keyboard shortcuts on platforms, when they use the term "g", you refer to the placement of "g" in the dvorak keyboard layout?

bierlingm commented 4 years ago

My general expectation as a Dvorak user is that my keyboard just works, haha... 😆

So yes, I expect "g" to mean "g" in the currently saved keyboard layout.

I never have problems with faulty input detection, since I've changed my keyboard layout on Mac to Dvorak via the System Preferences.

Connoropolous commented 4 years ago

of course.

Early on some developers of Acorn started using a less conventional approach to listening to the keyboard events, and I went along with it not knowing exactly what the implications would be. Now I do, we'll switch it back to the standard, and that will fix that I'm sure.

This issue will become a technical issue for tracking from now on.

Ooo, just discovered this is extremely trivial to fix. Will just switch this line from event.code to event.key and we're golden. MDN docs specifically mention DVORAK and such. https://github.com/h-be/acorn-ui/blob/master/src/event-listeners/index.js#L57

Connoropolous commented 4 years ago

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key