Closed shoulders closed 1 week ago
I'm thinking that I should keep the Alt (as right Alt) and not change its legend to Alt Gr, because that is not familiar to most users. but also check for Alt Gr code when it is pressed for the sake of completeness, unfortunately I couldn't find the code for Alt Gr key, if you know its exact code, I can implement this feature. Reference: https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values
Alt right is wrong because you don't call the left one alt left. Definitely use Alt Gr.
People might know the key as the alt right because it is an alt key on the right hand side.
The enter and return keys are different keys but normal people assume they are the same.
It is best to keep the property names as this is what leads to people using their simple names.
I will see if I can find the keycode for you
Thanks
looks like there is no longer a specific code for AltGr so people emulate it
if (event.ctrlKey && event.altKey) {
// Appears to be Alt Gr
}
Alright, I added the code to detect the AltGr key press, now if you press it, Right Alt should be highlighted. (which is in the same physical location). Test it and tell me if it is working as expected.
2 things
Ctrl
button.
Ctrl+Alt
to emulate the Right alt/Alt GR button.Ctrl+Alt
to see if it would trigger AltGr detection on those other keyboards and i come to the conclusion, i cannot, the timing must be exact and I am human.Alt Gr
should be the name 😄 of the button, but I can live with Alt
.Alright! I think I finally fixed it! It should now correctly detect the AltGr with the help of e.key. Test and see how it goes! 😄 Thanks for the feedbacks btw.
left ctrl
flickers when you press `AltGr , however it does not stay illuminated.Your welcome, thanks for the keyboard tester.
Glad to hear that it works. That flickering issue must be the delay of the browser to execute this part of the code:
document.querySelector('.' + 'controlleft').classList.remove('key-pressing-simulation');
document.querySelector('.' + 'controlleft').classList.remove('key--pressed');
I think the current implementation is good enough, if I figured out a better solution, I will replace it.
Alt
should beAlt Gr
Proposed solution
Alt
key toAlt Gr
Alt Gr
as an independent Key