I was wondering if there was a way to make a player object receive the scroll messages from a mouse with a scroll wheel or from a two finger scroll gesture on a Mac Book Pro track pad.
The Quicktime Player application and a quicktime player in a web page does receive these so you can scrub back and forth in the video with the scroll button or on the track pad. I have tried this with a player in revolution and it does not work.
Martin
control player object with mouse scroll wheel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 256
- Joined: Sun May 27, 2007 8:19 pm
-
- VIP Livecode Opensource Backer
- Posts: 256
- Joined: Sun May 27, 2007 8:19 pm
Thanks for the tip.
I managed to trap the rawkeydown messages and have them change the player's current time by putting the handlers I have listed below in the player's script, but, now when I scroll the mouse wheel up and down the slider in the movie controller moves accordingly but the movie does not redraw. If I click on a step button or push play then the movie will refresh and show the next frame. Is there another command that I need to make it redraw?
I don't have this problem in other situations where I set the currenttime of the player. It jumps to a new location and the movie display is updated. Is it because it is such a small increment?
on rawKeyDown theKeyNumber
if theKeyNumber is 65308 then stepforward -- mouse wheel down
else if theKeyNumber is 65309 then stepbackward -- mouse wheel up
else pass rawKeyDown
end rawKeyDown
on stepforward
set the currenttime of me to (the currenttime of me) + ((the timescale of me / 4))
end stepforward
on stepbackward
set the currenttime of me to (the currenttime of me) - ((the timescale of me / 4))
end stepbackward
Martin Koob
I managed to trap the rawkeydown messages and have them change the player's current time by putting the handlers I have listed below in the player's script, but, now when I scroll the mouse wheel up and down the slider in the movie controller moves accordingly but the movie does not redraw. If I click on a step button or push play then the movie will refresh and show the next frame. Is there another command that I need to make it redraw?
I don't have this problem in other situations where I set the currenttime of the player. It jumps to a new location and the movie display is updated. Is it because it is such a small increment?
on rawKeyDown theKeyNumber
if theKeyNumber is 65308 then stepforward -- mouse wheel down
else if theKeyNumber is 65309 then stepbackward -- mouse wheel up
else pass rawKeyDown
end rawKeyDown
on stepforward
set the currenttime of me to (the currenttime of me) + ((the timescale of me / 4))
end stepforward
on stepbackward
set the currenttime of me to (the currenttime of me) - ((the timescale of me / 4))
end stepbackward
Martin Koob
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Hi Martin,
Try changing your code to this:
locking/unlocking the screen worked on my end. Also adding round() to the calculation is necessary for movies that don't have a timescale of 600 (mp4 and mpg for example).
Try changing your code to this:
Code: Select all
on stepforward
lock screen
set the currenttime of me to (the currenttime of me) + round(the timescale of me / 4)
unlock screen
end stepforward
on stepbackward
lock screen
set the currenttime of me to (the currenttime of me) - round(the timescale of me / 4)
unlock screen
end stepbackward
locking/unlocking the screen worked on my end. Also adding round() to the calculation is necessary for movies that don't have a timescale of 600 (mp4 and mpg for example).
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder