Its quite lengthy but I will attempt to explain, with the assumption you know your lua scripting
In the Character Template:
input_mapper.lua: Defines the keystroke. In this lua file you assign "input.whatever" a key or "input.whatever=Keyboard.pressed(Keyboard.button_id("i"))" in local function update_button_input(self, dt)
Also in this file,
function InputMapper:if_whatever()
return self.input.whaterver
end
is the file that has access to the keyboard assignment.
player_hud.lua: Is the lua file that interfaces player to the Scaleform buttons, text, blah blah blah, which resides in Main,lua. In this file you create a function.
Example
function updateToScaleform(myVar)
local event = {
eventId = scaleform.EventTypes.Custom,
name = nil,
data = nil,
}
event.name = "update_that_button"
event.data = myVar
if event.name and event.data then
scaleform.Stage.dispatch_event(event) --Important reference function
end
print ("[player_hud.lua]: updateToScaleform")
end
The variable "event" is a table with two indices: 'event.name' and 'event.data'
event.name is the actor as define by Scaleform Editor while event.data is the whatever data you want to pass. In your case, instead of updating the Scaleform project, this is where you place your animation call.
The function updateToScaleform(myVar) is in association with this function as a means for player.lua to access.
function PlayerHud:check_whateverKey()
return self.input.whatever
end
Main.lua: Lua file located in UI folder of your project, this file is the file that modifies the state of your Scaleform project during game time. When updateToScaleform(myVar) is called, its communicates to Main.lua to perform the update. Not required since you are doing animation call.
player.lua: Finally all tied to this file.
local function check_whatever(self)
local whatever = Appkit.input_mapper:if_whatever() or PlayerHud:check_whateverKey()
if whatever then
updateToScaleform(myvar)
end
end
the check_whatever(self) is waiting for a keyboard signal and it
is lined in function Player:update(dt) to be checked during frame updates.
So to your question; yes, you can do lua scripting to get custom keystrokes.
Respectfully
Joseph