How about only assigning the button when it is released, that way you can go imaginary code here:

bool Button1Pressed false
bool button2pressed false
if anyButton is pressed
if button1 null
button1 = anyButton
elseIf !button1 null
if button2 null
button2 = anyButton
elseIf !button2 null
speak ("Only two buttons can be assigned to a functin")
retry assignment
end if
end if
if !anyButton is pressed
if !button1 null
if button2 null
assign function to button1
elseIf !button2 null
assign function to button1+button2
end if
end if
end if

Ok I just desperately confused myself but hey I tried. *grin*. I don't know how to explain my thought, or how doable it is based on how you are able to interact with the joystick's information. The attempt to explain it is don't assign the function until a button has been pressed and then released, and when a button is pressed, if it is the second button pressed with another button being pressed down at that time too, assign the first button to be your modifyer with the second button as the actual button to perform the action once both buttons have been released.

Ok I'm going to go press a couple of buttons that should hopefully remove this headache I just gave myself. rofl



if button1pressed
if !button2pressed


You just have to complicate matters depending on how the joystick interaction code really works, and also check every possible button.

On 1/18/2011 7:56 PM, Thomas Ward wrote:
Hi Kai,

Well, its like this. DirectInput can certainly handle multiple button
states. I do a little of that for walk, run, jump, etc. While
DirectInput certainly supports multiple buttons together to combined
moves my problem is creating a profiler that can map multiple buttons
at the same time I.E. be able to hold two buttons down and map them
both at the same time to a certain function.

For example, there are a lot of status functions like speak ammo,
speak health, speak strength, etc. Well, it makes sence if I created a
speech modifier button and hold that down with fire weapon it would
speak ammo. That's a logical button asignment. Problem is there are
things like speak health that doesn't have an associated action like
fire weapon, and you have to hold down the speech modifier key and the
speak health button at the same time to map them. I haven't figured
out how to do that yet.

I suppose one way to do it would be to ask for a modifier button,
press it, and then it asks you what button you want to use to speak
health etc. Basically, break it down into multiple steps like this.

"Please, select the speech modifier button."
"Please, select a button to speak health."

If done that way I imagine i could easily map more than one button to
any function. it just would involve more steps.


HTH


On 1/18/11, Kai<kaixi...@sbcglobal.net>  wrote:
Greetings Thomas.

A lot of console games, rather than assigning a specific function to every
key, assign certain keys as modifiers, so that holding a key + another key
performs a function.

Lets take our Rumble 2 / F510 gamepad and MOAT as an example:
One could hold down L2 (Button 7, the bottom left shoulder button) as a
modifier. Pressing left/right would then make Angela run in the respective
direction. Pressing up would then cause her to climb, and pressing down
could then make her crouch.

Holding R2 (Button 8, the bottom right shoulder button) plus a direction
could cause Angela to jump in the appropriate direction.

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.


---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to