News for hackers. Stuff that matters.
Re:Rocket – A Rust game running on WASM by htgb on Monday December 04, 2017 @10:09AM (#15844346)
I'm not sure if it's possible to access the character given the key code (the docs you linked implies it's not), but when we're interested in physical keys, I'd much rather use that nonetheless.

A good way to illustrate the controls could maybe be with an image? The keys on the image could say WASD for all I care, as long as I'm able to see the position of them, which is what matters.

There are similar issues for other things than games. Quite a few programs have `Ctrl + /` or similar as a keyboard shortcut, which is easy on an american keyboard, but on a Swedish one there's no dedicated key for slash (it's `Shift + 7`). The same goes for most symbols except A-Z (I use Swedish QWERTY), they are in other locations and with other modifiers.

Best, of course, is when you can get the character based on the physical key. One example of this is Visual Studio Code, where the shortcut for toggling the console is `Ctrl + Ö`, and presented as such. I assume they defined the shortcut by the physical key (the one to the right of `L` in this case) and presented it by its character.

Re:Rocket – A Rust game running on WASM by mrec on Monday December 04, 2017 @10:52AM (#15844762)
Yeah, in a native app you'd use something like MapVirtualKey [1], but I don't think there's a web equivalent yet.

You still see native apps getting this wrong, though. On a UK keyboard Sublime Text's view menu says that "Show Console" is Ctrl-` (backtick), but the key that actually shows the console is Ctrl-' (single quote). Took me a while to find that.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

Re:Rocket – A Rust game running on WASM by KwanEsq on Monday December 04, 2017 @02:21PM (#15846615)
Huh, I'm using SublimeText with a UK keyboard and Ctrl+` shows the console (Ctrl+' just types a ')

That's on Linux though, what are you on, Windows? SublimeText Version 3.0, Build 3143

Re:Rocket – A Rust game running on WASM by mrec on Monday December 04, 2017 @02:39PM (#15846756)
Yeah, Windows 3126. May have been fixed, but definitely not just me: see https://forum.sublimetext.com/search?q=console%20uk