orxInput_Bind

edited May 2013 in Help request
I have been looking into examples of orxInput_Bind and I don's see any.

My understanding is that I can create an orx object (button), call

''orxInput_Bind("ActionName", orxINPUT_TYPE_EXTERNAL, ActionButtonId);''

and then I can use

orxInput_SetValue("ActionName", 1);
orxInput_GetValue("ActionName"...

It seems that I can simply use SetValue and GetValue without bind. When would I use orxINPUT_TYPE_EXTERNAL? What exactly is the 3rd argument of the bind call?

Comments

  • edited May 2013
    There are a few examples in orx's code itself, such as:
    orxInput_Bind(orxRENDER_KZ_INPUT_PROFILER_TOGGLE_HISTORY, orxINPUT_TYPE_KEYBOARD_KEY, orxRENDER_KE_KEY_PROFILER_TOGGLE_HISTORY);
    

    You'll never use orxINPUT_TYPE_EXTERNAL as a parameter of any orxInput function, however, when an input has been activated via code and not via a physical peripheral, the event that is sent will contain orxINPUT_TYPE_EXTERNAL as type (in the aeType[0] field).

    As you noticed, you don't need to bind inputs in order to activate them: simply calling orxInput_SetValue() will create the input if it didn't already exist, similar as pushing a config section will create the section if it didn't already exist.

    The last argument is the ID of the peripheral's button/axis/key.
    For example, if the second argument is orxINPUT_TYPE_KEYBOARD_KEY, then it'll be interpreted as an orxKEYBOARD_KEY type, etc...
Sign In or Register to comment.