Artemis-RGB / Artemis

Provides advanced unified lighting across many different brands RGB peripherals
https://artemis-rgb.com
Other
964 stars 68 forks source link

Weird Key detection #360

Closed rakosi2 closed 4 years ago

rakosi2 commented 7 years ago

I have Type Wave on and I noticed that the Enter key on the numpad makes circles around the main enter key. Also the key above the main enter key, the "\ and |" key doesn't make any circles. While I'm at it any gkey doesn't make any circles but that maybe a cue issue. And lastly the winlock is not detected for keybinds /enable/disable (would be nice for a winlock indicator). I am using Corsair K95 US

DarthAffe commented 7 years ago

I can make a few assumptions about why this happens (I'm not able to debug this right now but I'm pretty sure it's something like this):

  1. G-Keys: All the key hooking isn't done directly through the driver (cue etc) since only the coolermaster sdk offers a way to do it. Instead it's done by using the global windows key-pressed/-released-events. That's the reason why special keys (g-keys, M1, M2, M3, etc) won't work. It's possible to get them through usb-reading (I wrote a proof of concept for this a while ago) but that's a whole lot of work since it needs to be done for every device on it's own.

  2. Enter: I'm pretty sure this caused by the same reason as 1. Windows detects the enter on numlock, but it detects it as enter (the same "key" as the main enter). That's why artemis isn't able to distinguish the two.

  3. The |-thing: This might be a bug in the key-mapping. As far as i know SpoinkyNL doesn't have a US corsair-keyboard for testing so there might be something wrong.

RobertBeekman commented 7 years ago

Hey, basically what @DarthAffe is spot on.

Unfortunately there isn't really an all-in-one solution for key detection on such a low level. The main enter and regular enter are the same thing according to keyboard events. This kinda makes sense since usually you're not concerned with the actual physical key.

By Winlock do you mean the button on the K95 that disables the Win key and alt-tab? That's a CUE-only feature that you can't really read?

Lastly, the key you described, I do not have it on my keyboard, could you run this? KeyPressTest.zip

That'll show you what the buttons you're pressing are called in .NET. (While you're at it you can press both enters and see that they are the same :c)

If you press the button above the enter and tell me what it is called, I'll add it.

rakosi2 commented 7 years ago

So for the "|" key I got Oem5 and got Return for both enter keys.

The USA keyboard is like the EU k95 but the Enter is smaller and the "|" is moved from next to the left shift to above enter. ex. C:\Program Files (x86)\Corsair\Corsair Utility Engine\devices\views\k95rgb\na.jpg

I tried to remap a random key to "Keypad Enter" but still get enter so it's using the same event.

For the winlock, yes it is what disables Win Key and the KeyTest was not able to see winlock, brightness, Mkeys and Gkeys. It would be nice to be able to see the winlock because it still work with Artemis but I can't tell if it's enabled without testing if it is.