0 registered members (),
677
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: XBox 360 Controller
[Re: oliver2s]
#439325
03/31/14 14:42
03/31/14 14:42
|
Joined: Jul 2013
Posts: 158
Feindbild
OP
Member
|
OP
Member
Joined: Jul 2013
Posts: 158
|
Hey, thank you for your helpful answers!! My problem with the default joy_* functions were 1) no vibration and 2) you can't press both triggers at once, one of the most important functions of them (zoom then shoot for example) I will look into the DirectInput API, that looks promising but complicated.
|
|
|
Re: XBox 360 Controller
[Re: Feindbild]
#439326
03/31/14 14:57
03/31/14 14:57
|
Joined: Aug 2002
Posts: 3,258 Mainz
oliver2s
Expert
|
Expert
Joined: Aug 2002
Posts: 3,258
Mainz
|
2) you can't press both triggers at once, one of the most important functions of them (zoom then shoot for example) Ah yes, that's right.
|
|
|
Re: XBox 360 Controller
[Re: DLively]
#439396
04/02/14 05:51
04/02/14 05:51
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
This allows for the triggers to operate. If anyone finds an algorithm for both triggers, I, Feindbild, and many others would appreciate it very much, until then Here is how you can get started with the triggers
var left_trigger;
var right_trigger;
var left_trigger_press;
var right_trigger_press;
function hold_triggers(){
left_trigger = maxv(joy_raw.z/255,0);
right_trigger = abs(minv(joy_raw.z/255,0));
left_trigger_press = (left_trigger>0);
right_trigger_press = (right_trigger>0);
}
action suchandsuch(){
while(comparison){wait(1);
if(left_trigger_press == 1 && right_trigger_press == 0){this();}
if(right_trigger_press == 1 && left_trigger_press == 0){this();}
}
}
Thank you for the contributiono Oliver2s I hope this is helpful for anyone else
Last edited by DevoN; 04/02/14 06:33.
|
|
|
|