Wie werden InputBindings im 19er definiert?

[LSMC] modelleicher schrieb dazu:

event listener:

    SpecializationUtil.registerEventListener(vehicleType, "onRegisterActionEvents", deinScript); -- this one is used to add the actionEvents

onRegisterActionEvents

-- actionEvent stuffs.. (this one is called each time the vehicle is entered)
function deinScript.onRegisterActionEvents(self, isActiveForInput)
    local spec = self.spec_fakeBox;
    spec.actionEvents = {}; -- needs this. Farmcon Example didn't have this. Doesn't work without this though.. 
    self:clearActionEventsTable(spec.actionEvents); -- not sure if we need to clear the table now that we just created it. I suppose you could create the table in onLoad, then it makes more sense
    
    -- add the actionEvents if vehicle is ready to have Inputs
    if self:getIsActiveForInput(true) then      
        local _, actionEventId = self:addActionEvent(spec.actionEvents, InputAction.INPUT_NAME, self, deinScript.FUNCTION_NAME, false, true, false, true, nil);
    end;

end;

funktion die aufgerufen wird wenn die Taste gedrückt wird

-- the functions called by the action events
function deinScript:FUNCTION_NAME()
    -- put stuff that happens when Input has event / is pressed here
end;

modDesc:

    <inputBinding>
        <actionBinding action="INPUT_NAME">
            <binding device="KB_MOUSE_DEFAULT" input="key_x" />
        </actionBinding>        
    </inputBinding>    
    
    <actions>
        <action name="INPUT_NAME" />
    </actions>

    <l10n>
        <text name="input_INPUT_NAME"><en>Helptext EN</en><de>Helptext DE</de></text>
    </l10n>