Author Topic: How do you get a joystick button 'Release' event???  (Read 2279 times)

Snacko

  • Newbie
  • *
  • Posts: 12
How do you get a joystick button 'Release' event???
« on: July 10, 2023, 12:56:07 PM »
Just like the title says..  I want to play a click sound when I press my global PTT button down.  I have that working fine.  But how can I find when the button is then released, so I can add the click at the end?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4780
  • RTFM
Re: How do you get a joystick button 'Release' event???
« Reply #1 on: July 10, 2023, 01:06:14 PM »
Two main methods:

Use a second command assigned to the same button, but with the "Shortcut is invoked only when all buttons are released" option enabled


Or, add a loop to your command that waits for the button to be released.
E.G.
Code: [Select]
Play sound, 'internal:Iamon'
Start Loop While :  Joystick 1 Button 1 Is Pressed
End Loop
Play sound, 'internal:Iamoff'

Snacko

  • Newbie
  • *
  • Posts: 12
Re: How do you get a joystick button 'Release' event???
« Reply #2 on: July 14, 2023, 11:41:51 AM »
Awesome!!  Thanks so much!!   ;D

LeviMitchell

  • Newbie
  • *
  • Posts: 2
Re: How do you get a joystick button 'Release' event???
« Reply #3 on: December 21, 2023, 09:03:59 AM »
Helpfull post.
Is here someone who follows bo3 team rankings ?
Have a nice day everyone