Hello,
I am currently working on action bars for my RPG and I want the player to have the ability to simply hover over a slot(on the action bar) and press the inputs for that specific slot. For example, hover over spell on bar and input control + k. Control +k now activates the spell in that slot.
So far my thoughts are creating new actions per instance the player does this. The main issue is how do I get which inputs were given, including composites (1/2 modifiers).
I actually found a basic solution but I do not know if there is a better built-in way. You can use this to see the latest input and just use that to create bindings.
if (!eventPtr.IsA<StateEvent>() && !eventPtr.IsA<DeltaStateEvent>())
return;
var controls = device.allControls;
var buttonPressPoint = InputSystem.settings.defaultButtonPressPoint;
for (var i = 0; i < controls.Count; ++i)
{
var control = controls[i] as ButtonControl;
if (control == null || control.synthetic || control.noisy)
continue;
if (control.ReadValueFromEvent(eventPtr, out var value) && value >= buttonPressPoint)
{
if(!control.path.Contains("mouse"))
{
Debug.Log(control.path);
}
}
}