Python Forum
run different functions each time the same button is pressed?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run different functions each time the same button is pressed?
#5
ahh, you're correct. Your code was working all along.

I just realised one button press is divided to the push and releasing of the button:

push:
BTN_TR
SYN_REPORT

release:
BTN_TR
SYN_REPORT

So if I push it down, it switches to the next mode. Upon releasing it switches again.

That was my mistake. Your code works great!
Reply


Messages In This Thread
RE: run different functions each time the same button is pressed? - by User3000 - Jul-31-2020, 10:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting button pressed number Moris526 4 2,548 Dec-14-2020, 01:41 AM
Last Post: Moris526
  How many times was the button pressed in pyglet rama27 0 1,978 Oct-10-2020, 10:26 AM
Last Post: rama27
  Terminate a process when hotkey is pressed 66Gramms 0 2,311 Dec-24-2019, 06:41 PM
Last Post: 66Gramms
  Advance program when certain keys are pressed? Chrislw324 2 2,413 May-19-2019, 07:13 PM
Last Post: woooee
  Count to movement according to the time pressed button noartist 1 2,579 Feb-27-2019, 01:33 PM
Last Post: noartist
  Time multiple functions within functions Cortessizzz 4 3,224 Jan-09-2019, 04:15 PM
Last Post: Cortessizzz
  How can classes access each other Functions and Variables at the same time PythonOK 4 3,154 Dec-09-2018, 03:46 AM
Last Post: ichabod801
  What key pressed? ian 2 5,097 Jul-29-2018, 02:30 AM
Last Post: snippsat
  Can't edit code after I've pressed enter. xBlackHeartx 2 12,270 Sep-02-2017, 10:04 PM
Last Post: nilamo
  Button Presses in Certain Time Frame MsCheeseyPuff 3 4,122 Jun-30-2017, 08:39 PM
Last Post: MsCheeseyPuff

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020