The Volume Down key on a laptop is interpreted as Keys.C
KeyboardState ks = Keyboard.GetState();
// The following is output whether the user presses C or Volume Down
if (ks.IsKeyDown(Keys.C))
Console.WriteLine("C or Volume Down is pressed");
// Keys.VolumeDown will never fire
if (ks.IsKeyDown(Keys.VolumeDown))
Console.WriteLine("This will never print");
Hmm, just tested this and it works fine for me. What keyboard layout are you using?
Interesting. I use the UK keyboard layout on two different models of laptop.
Yup, can't reproduce it.
@cra0zy - So this must be an SDL2 issue correct?
@Pixelnicks - Can you share the make/model of laptop? Is this one of these keys where you have to press some other function key first? Is there any key remapping software running on the laptop?
@cra0zy - So this must be an SDL2 issue correct?
Most likely.
It occurs on two laptops:
Dell XPS 13 4243
Volume down: FN+F2
ASUS ZenBook UX430UA-GV415T
Volume down: FN+F11
There's no key remapping.
Curious it occurs on two very different laptops.
Can someone else check Keys.VolumeDown on their laptop to see if maybe this has just always been broken?
Here's a list of all special keys which are mapped incorrectly for me on the Asus. I no longer have access to the Dell.
Volume Up: B
Volume Down: C
Mute: D
Touchpad enable/disable: LeftControl & LeftWindows
Toggle laptop display/external display: LeftWindows
This happened to me on MonoGame 3.5 and still happens on 3.7.0.1129. I'm using Windows 10 on an Alienware 15 R3, and it doesn't seem to occur until I've pressed the C key at least once. I'm also targeting DesktopGL. It reports most of the same mappings Pixelnicks has for me as well. I'll list everything for completeness:
Volume Up (Fn + F5): B
Volume Down (Fn + F4): C
Mute (Fn + F3): D
Airplane Mode (Fn + F2): D3
Toggle Windows Key (Fn + F6): F9
I/D GFX (switches between integrated/discrete graphics - does nothing on this one) (Fn +F7): Space
Project (Fn + F8): Left Windows
Brightness Down (Fn + F9): D4
Brightness Up (Fn + F10): D5
Touchpad Toggle (not supported on this model) (Fn + F11): Escape
I'm using a US English QWERTY keyboard. There's no key remapping to my knowledge.
@cra0zy - Seems like we need to make a simple SDL2 test app and verify this is a SDL2 bug and if so report it to them to review.
Sure, I'll cook up an example in C.
I think the SDL team were aware of this, as I think this bug tracker mentions something like this:
https://bugzilla.libsdl.org/show_bug.cgi?id=3247
I'm struggling to navigate the website to figure out where this commit with the fix is placed, but I think it's part of release-2.0.6 (as per fishing through the link of the last comment in that bug tracker).
I forgot to cook up an example in C, sorry about that.
I'm struggling to navigate the website to figure out where this commit with the fix is placed, but I think it's part of release-2.0.6 (as per fishing through the link of the last comment in that bug tracker).
Awesome, so we just need to update SDL.
SDL was updated to 2.0.7 in #6186, so this is fixed :)
Nope, it only got bumped up for Linux back then.
Oops, sorry.
Is there any progress on this? What would be required to update and test SDL within MonoGame?
We are waiting for @tomspilman, he started doing some work with new dependencies(assimp and NVTT), merged the PR to dependencies repo, than stopped midway so now no new dependencies can be submitted until that work gets done :(
Also waiting for build bot to come online as well.
@cra0zy the bots and up :) and I think the assimp/nvtt stuff is done now
They are not, still waiting for the @tomspilman assimp dependency bump PR.
@dellis1972 @cra0zy - I'll get that fixed up this week.
SDL 3.0.8 has been merged, this issue should be fixed in devel.