Detects a single-frame press of the left trigger.
Takes controller (Int).
Returns 1 only on the frame when trigger transitions from released to pressed, then 0 until released and pressed again.
Input
Parameters & Returns
Parameters
controllerInt
Returns
Int
Quick Summary
Detects a single-frame press of the left trigger.
Takes controller (Int).
Returns 1 only on the frame when trigger transitions from released to pressed, then 0 until released and pressed again.
Technical Exegesis...
Returns 1 only on the single frame when the left trigger transitions from released to pressed (beyond the threshold), then returns 0 until the trigger is released and pressed again. This is useful for detecting trigger pulls as discrete actions rather than continuous holds.
Unlike inpLeftTriggerDown() which returns 1 continuously while the trigger is held, this function only returns 1 once per press. The threshold is approximately 25-30% of the trigger's range.
Returns 1 only on the single frame when the left trigger transitions from released to pressed (beyond the threshold), then returns 0 until the trigger is released and pressed again. This is useful for detecting trigger pulls as discrete actions rather than continuous holds.
Unlike inpLeftTriggerDown() which returns 1 continuously while the trigger is held, this function only returns 1 once per press. The threshold is approximately 25-30% of the trigger's range.
The controller must be created with inpCreateController() and updated with inpUpdateController() before checking trigger state. Only returns input when the active canvas or window has focus.
Example
Example.bam
Include "BBR_INCLUDE.bam"
Local controller:Int = inpCreateController(0)
Local shotCount:Int = 0
Forever
inpUpdateController(controller)
If inpLeftTriggerHit(controller)
shotCount = shotCount + 1
Print "Shot fired! Total: " + shotCount
End IfIf inpIsKeyHit(VK_ESCAPE) Then Exit
Forever
inpFreeController(controller)