Community Forum

Input binding

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created03.03.2011 07:39


Thorsten Müller (Unknown) 03.03.2011 07:45
Hi,

i have definded the following block in the xml definition of my mod:

<part name="deichsel" upSpeed="1" downSpeed="-1" keyUp="KEY_1" keyDown="KEY_2"/>

Now i want use the Inputbindung.hasEvent() with the xml entry keyUp and keyDown to start the animation.

Is there a function in the inputbinding.lua to convert a string key into a input key?

Thanks a lot
Thorsten

Thomas H. (Patar) 05.03.2011 10:34
you can get the string from the xml-file with:

self.keyUp = getXMLString(xmlFile,"vehicle.part# keyUp")
self.keyDown = getXMLString(xmlFile,"vehicle.part# keyDown")

and use hasEvent:

if Inputbindung.hasEvent(self.keyUp) then
...
end;


if Inputbindung.hasEvent(self.keyDown) then
...
end;


I think that should work, but i'm not sure.


Note: Log in to post. Create a new account here.