Author Topic: Play/Stop from position shortcut?  (Read 239 times)

Offline Elvisish

  • Shy artist
  • Posts: 3
Play/Stop from position shortcut?
« on: July 28, 2022, 23:52:52 »
Is there a way of setting up a shortcut to toggle between play and stop, but return to the starting position it was at? Play/pause and play/stop returning to the beginning seem possible, but not stopped and starting from the same point?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,515
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Play/Stop from position shortcut?
« Reply #1 on: July 30, 2022, 17:57:24 »
Unfortunately there is no single built-in shortcut that can accomplish this. What you could try is turning on the hidden setting Misc.AllowMultipleCommandsPerKey, and then map both the Stop command and the Play/pause command to the same key. I should add that I haven't tried it myself and it could very well be that this doesn't work, because the stop command might trigger after the play pause command instead of before. Another option could be to map the Stop command to the "key down" action of a key and the "Play/Pause" command to the "key up" action of that key, to guarantee that stop is always executed first.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Elvisish

  • Shy artist
  • Posts: 3
Re: Play/Stop from position shortcut?
« Reply #2 on: July 31, 2022, 13:25:31 »
map both the Stop command and the Play/pause command to the same key.
This actually seems to block all playing (I guess because it's done at the same time).
Another option could be to map the Stop command to the "key down" action of a key and the "Play/Pause" command to the "key up" action of that key
This means I have to hold the key, which isn't preferable, haha. I've opened an FR: https://bugs.openmpt.org/view.php?id=1619 - I've never opened one before so I'm not too sure if I need to add much more detail to it or not.

Thanks again for the suggestions!

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,515
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Play/Stop from position shortcut?
« Reply #3 on: July 31, 2022, 21:04:15 »
No matter how long you press a key, it should always generate a key-down and key-up event, so you wouldn't need to hold it any longer than normal. But having a dedicated command might make more sense in the long run, so that feature request is a good idea. It's fine as it is.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Elvisish

  • Shy artist
  • Posts: 3
Re: Play/Stop from position shortcut?
« Reply #4 on: July 31, 2022, 21:32:48 »
No matter how long you press a key, it should always generate a key-down and key-up event, so you wouldn't need to hold it any longer than normal. But having a dedicated command might make more sense in the long run, so that feature request is a good idea. It's fine as it is.
I did actually try it, the key needed to be held down to play and when I released, it stopped. I also tried flipping the keys around and it didn’t play at all.