Author Topic: AttractMode timer suggestion  (Read 2890 times)

NeoID

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
AttractMode timer suggestion
« on: May 10, 2017, 08:07:29 AM »
Hi,

Is there a reason why the AttractMode timer uses a internal timer instead of just looking for the last time the gamepad/keyboard was used? I have made an external application that adds coin acceptor and RFID support for launching games. My problem is that my application suspends RetroFE when a RFID tag is scanned, but once you return to RetroFE (say after 10 minutes or so) AttractMode kicks in. So suspending the process doesn't suspend the timer (I use SuspendThread/ResumeThread in C#).

If RetroFE wouldn't use a timer, but look at the activity of the input devices I assume that wouldn't be a issue and a better solution as you wouldn't need to worry about resetting it all the time?

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: AttractMode timer suggestion
« Reply #1 on: May 10, 2017, 08:42:35 AM »
I'm open to suggestions on how to do that to be honest. As far as I know, an application has no knowledge of the keyboard/mouse usage outside itself, so it can only react to activity within its own program. If you can point me to a way to solve this cross-platform I'll be glad to program it. :)

NeoID

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: AttractMode timer suggestion
« Reply #2 on: May 10, 2017, 08:54:02 AM »
Thanks. I'll look into it, but I have unfortunately no knowledge of C++.
In C# I've used GetLastInputInfo in order to get the last input time. Not sure if that can be used or if there are other alternatives like it. It worked at least great with touchscreens and keyboards. I haven't tested it using a gamepad yet though.