Blockland Forums > Modification Help

Button commands

Pages: (1/2) > >>

Pah1023:

I am wondering how you could press a button for example Z,
in a gui and it will do the function a apply to it.
I have been looking, and I cant find out how.

PurpleMetro:

So you are telling me you couldent find THIS: http://forum.blockland.us/index.php?topic=67198.msg1122571#msg1122571 In the first topic of General Modification Help. I doubt you looked XD

Pah1023:


--- Quote from: PurpleMetro on September 02, 2011, 10:40:46 PM ---So you are telling me you couldent find THIS: http://forum.blockland.us/index.php?topic=67198.msg1122571#msg1122571 In the first topic of General Modification Help. I doubt you looked XD

--- End quote ---
No, not that, I believe its something do with actionmap, the Editor script has what I need, once I get to my computer I will see.

Pah1023:

Sorry for double posting but I found out that it uses an action map.
But now I need the variables and there two different commands.

Actionmap.bind()
and actionmap.bindcmd().

Wich do I use?

wizzlemanizzle:

sorry for bump, hope this helps though

--- Quote from: The Torque Appendix Section A.2.1 Action Map ---bind( device , action , [ modifier , mod... ] , command )
Purpose
Use the bind method to associate a function to a keystroke or other device input.
Syntax
device - Name of the device to bind the command to (see 'Device Table' below).
action - Name of the action to watch for(see 'Action Table' below).
modifier – Special modifiers (mouse only), such as dead spot, etc.
command - The function to be called on make and break.
Returns
No return value.
Notes
The command bound via the bind function must be specified as a flat name with no elipses
or semi-colon termination and will be called on make and break events (i.e. key press and
release for a mapped key).
Args:
Warning: When a function is bound to a keystroke or other device input, and no other
versions of the binding are provided, the function will be called even if a modifier key
like CTRL, ALT, or SHIFT is also pressed. For clarification, see 'Bind Sample' example
below.
--- End quote ---

In your case:
actionmap.bind(keyboard0, Z, , , function(););
however... I don't think it is possible to make it so that this ONLY works while a specific GUI is open....

Pages: (1/2) > >>

Go to full version