Giter Site home page Giter Site logo

Add support for key-events about cue.net HOT 11 CLOSED

darthaffe avatar darthaffe commented on August 26, 2024
Add support for key-events

from cue.net.

Comments (11)

DarthAffe avatar DarthAffe commented on August 26, 2024

I'm just experimenting around a bit and got something to work for me.
Now I run into the same problem as before: I only own one keyboard to test.

@SpoinkyNL could you help me out with that, run the test application and report back to me what happened?

Test-Application: http://uploads.wyrez.org/CUEInputTest.zip

The keyboard test should turn the whole keyboard black and light every key as long as it is pressed (this includes g-keys and other special keys - it should work for the whole keyboard independent of the layout). Remember to type in an editor since the test-app exits on key-press :p

I think you got a rgb-mouse so you could run the mouse-test too. It should do the same but I don't think that it will work. Maybe it shows at least an exception.

from cue.net.

RobertBeekman avatar RobertBeekman commented on August 26, 2024

Hey, the keyboard sample works as expected on K95 and Strafe. The mouse version did turn everything black but nothing lid up when pressing buttons

from cue.net.

RobertBeekman avatar RobertBeekman commented on August 26, 2024

Do you have Discord or anything similar? I know someone at Corsair who I'm sure can get you some extra RGB gear. (Not that I mind helping 😄)

from cue.net.

DarthAffe avatar DarthAffe commented on August 26, 2024

Ok, that's what I expected ... Mice seem to have a different protocol (what makes perfect sense).

from cue.net.

Elestriel avatar Elestriel commented on August 26, 2024

I can check this out on my Strafe RGB, K70 RGB, and K95 RGB as well, if you want. I've also got an M65 RGB, Scimitar, Scimitar Pro, and Sabre. This might allow me to completely drop my horrendous RawInput hooks and use these instead!

from cue.net.

DarthAffe avatar DarthAffe commented on August 26, 2024

Sure, my biggest problem right now is, that I don't know if I'm always selecting the correct device (there are multiple hids with the same ids) and the current condition is chosen by trial and error. So every test is welcome :)

You can also check out the code already https://github.com/DarthAffe/CUE.NET.Input

from cue.net.

Elestriel avatar Elestriel commented on August 26, 2024

I got it working on my Strafe RGB. I'll try the other two when I get home from work.

The input reading is a lot nicer than my current methods, so I'll try to implement them in my software and push an update. That way, it'll go out to a few hundred users, and I know that some of them use reactive typing. We'll no doubt get reports back almost immediately if there are any huge issues!

As an aside: I just updated to 1.1.0.2... I have been on 0.2.0 for a long, LONG time. That took some figuring out. Unfortunately, brushes and the likes don't help me much, since I've already got rendered frames in my buffer. Got it working anyway, though. I see output at 120 FPS, but I wonder if CUE.NET just drops frames that it can't push? Edit: it definitely drops frames, because I know these devices can't handle 700 FPS. On that note, now I know that my software can handle 700 FPS. It actually rips data out of WASAPI so fast that it causes buffer underruns. I'm kind of proud of that.

from cue.net.

DarthAffe avatar DarthAffe commented on August 26, 2024

Sounds like a plan :)

Unfortunately, brushes and the likes don't help me much, since I've already got rendered frames in my buffer.

I'm not aware how you internally organizing your data but applying the buffer to the keyboard should be really easy using a specialized brush! But that's up to you - setting colors by LedId is still possible.

I see output at 120 FPS, but I wonder if CUE.NET just drops frames that it can't push?

This was an issue in older versions. With the latest sdk this seems to be fixed (#19) (i pushed that with the ambilight way further than in the example in this issue) but I don't know how this is handled by CUE.

from cue.net.

Elestriel avatar Elestriel commented on August 26, 2024

CUE runs at 40 FPS, which I've confirmed with Corsair techs. When I look at the keyboard, it does look to be about that much. I would assume the SDK runs at the same speed as things within CUE itself! I'm able to push my Strafe RGB to 78 FPS using my own device control instead of the SDK, so I doubt it can get much higher than that.

My layers are fairly complex, with masking and opacity and blending and all the likes. I'll have to figure out what the optimal way to port them to CUE.NET would be, but for now, I'd rather focus on the task at hand.

from cue.net.

check-waas avatar check-waas commented on August 26, 2024

Hello DarthAffe.

I'm trying to do an app to make my Strafe RGB show all shortcuts from a program like After Effects for example. Just run your CUEInputTest here and it make me believe that it's really possible using your CUE.NET.Input and CUE.NET.

Is it possible to check if 2 or 3 keys are pressed at the same time? Like CTRL+SHIFT or CTRL+ALT+SHIFT?

If yes, can you give access to your CUEInputTest code? I think my idea is just like it. Just need to start showing the single key shortcuts, and check if any of these 6 combinations (CRTL, SHIFT, ALT, CTRL+SHIFT, ALT+SHIFT, CTRL+ALT+SHIFT) are pressed. If yes to one of these change the colors to match the shortcuts that it activate. As soon I release the keys it will come back to the original state (single key shortcuts).

Thanks anyway for your attention, and congratulations for your fantastic work here.

from cue.net.

DarthAffe avatar DarthAffe commented on August 26, 2024

Sure, you can check for every key or combination you like.
Right now there are two ways to do this:

  1. Register an inputeventhandler and manage the key states on your own:
CueSDK.KeyboardSDK.RegisterOnInput((sender, eventArgs) => /* do some cool stuff here */));
  1. Get the currently pressed keys from the device and do what you want with them:
CorsairLedId[] pressedKeys = CueSDK.KeyboardSDK.GetActiveInputs();

Note that you need to attach an eventhandler (it can be an empty one) even if you only want to work with GetActiveInputs!

You could also take a look at the example here.

from cue.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.