Search Unity

Getting the Raw Buffer Directly?

Discussion in 'Input System' started by Rickmc3280, May 4, 2021.

  1. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    189
    Is there a way to get the raw data directly? What would be the best method to get feedback from the new Input System with the least amount of processing power? I created several actions and I see the Value/Button/Passthrough and understand that Passthrough has less processing...

    However, I created a set of scripts previously in order to get data from the XR system and it was fairly efficient... It also included ways to detect double,triple, quadra clicks which gave additional functionality for shortcuts/quickkeys. I was hoping that there is a way to get data from the buffer where I can process it directly? Also I was curious if yall use marshaling where yall could in theory pass the raw data on top of the struct and simply update the data by "putting it on top of the struct"? This is a separate request but it was part of my next steps in super fast input processing.

    So, is there a way to get the buffer? Also I noticed that ReadValue<bool> is not a thing... but in the debugger its processed as a bool, but normally its processed as a float of 0/1 for normal buttons... Is there a way to read it as booleans? I also see that it uses bits which I know is not necessarily efficient due to extracting a lot of info, but there is masking where you could create a byte mask and overlay it (And - ing) etc. If I wanted to create my own system without using the XR stuff... what is the best way to get the data with performance in mind?

    Edit to add:...

    Also... I would consider using yalls directly if yallve already maximized performance... but the whole... TriggerButton.Started ... TriggerButton.Cancelled .... is kind of weird? Why would yall not just label the events where they could be easily used as TriggerButton.Pressed and TriggerButton.Released? Ive messed with several iterations or keywords, and Pressed/Held/Released seem to be the most common and easy to use. Also.. TriggerButton.Performed? Is this meant to be a variation of Held?


    Also, I have seen the Interactions and know that you can technically do double clicks with the tap feature, but they also fire regular clicks, which is problematic to do both.
     

    Attached Files:

    Last edited: May 4, 2021