scrolling with mouse wheel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 11
- Joined: Mon Apr 10, 2006 5:39 pm
scrolling with mouse wheel
I've been feeling overwhelmed by the email list, being a user of modest ability, with many other priorities. I'd been wishing that RR would set up a list better suited to users like me. So I guess it's only fair that I would post first.
BTW, many thanks to RR for setting up the new forum.javascript:emoticon(':)')
I have a long (tall) scrolling backgrounds on some cards, and on some cards I have a scrolling field, containing hudreds of lines. These are mostly clickable index fields.
I'd like to be able to scroll the backgrounds or fields in question with the mouse wheel -- vertically. On any given card, there would only be one field or bg I would want to scroll with the mouse wheel.
I can't figure out how to do it. The message watcher shows a scrollbardrag message when I move the mousewheel, but I don't know where to go from there.
Please advise,
Tim
BTW, many thanks to RR for setting up the new forum.javascript:emoticon(':)')
I have a long (tall) scrolling backgrounds on some cards, and on some cards I have a scrolling field, containing hudreds of lines. These are mostly clickable index fields.
I'd like to be able to scroll the backgrounds or fields in question with the mouse wheel -- vertically. On any given card, there would only be one field or bg I would want to scroll with the mouse wheel.
I can't figure out how to do it. The message watcher shows a scrollbardrag message when I move the mousewheel, but I don't know where to go from there.
Please advise,
Tim
-
- Livecode Opensource Backer
Re: scrolling with mouse wheel
This is supposed to work without any coding. Click on the field (in browse mode), then use the mousewheel, and this should gets you scroll up and down the textfield with the mousewheel.blingbling wrote:I'd like to be able to scroll the backgrounds or fields in question with the mouse wheel -- vertically. On any given card, there would only be one field or bg I would want to scroll with the mouse wheel.
Does it work differently on your platform (I just checked this behaviour on mac osx)? Or is it that you would like to overwrite the default behaviour?
You may want to have a click on the field each time a card is open to make sure this works straightaway (i.e., to have the textfield become active so that any scroll comes to act on it). For this use the click instruction (on opencard - click at "100,100" - end opencard) or the mouseup instruction (on opencard - send mouseup to field "scrollablefield" - end opencard).
Don't hesitate to let us know ways in which this answer fails to answer your question.
-
- Posts: 22
- Joined: Mon Apr 10, 2006 1:42 pm
- Location: Atlanta
- Contact:
If you want to scroll a group (background), you need to intercept the rawkeydown message.
Here is the relevant script for a windows system, I assume it works on other systems as well:
on rawkeydown pKey
if pKey = 65309 then
put the vscroll of me into A
put A - 14 into B
set the vscroll of me to B
else if pKey = 65308 then
put the vscroll of me into A
put A + 14 into B
set the vscroll me to B
else
pass rawkeydown
end if
end rawkeydown
Here is the relevant script for a windows system, I assume it works on other systems as well:
on rawkeydown pKey
if pKey = 65309 then
put the vscroll of me into A
put A - 14 into B
set the vscroll of me to B
else if pKey = 65308 then
put the vscroll of me into A
put A + 14 into B
set the vscroll me to B
else
pass rawkeydown
end if
end rawkeydown
-
- Posts: 11
- Joined: Mon Apr 10, 2006 5:39 pm
Hi Jonathan and Marielle,
I know you guys from the list! You've always been very supportive. It's nice to see friendly faces, so to speak.
Jeez, maybe I shoulda just used my name for my username instead of some silly alias. I want to be personable. What do you suggest?
Jonathan -- I'm amazed! Your script for scrolling the bg worked perfectly, right out of the box. It usually isn't that easy. Thanks a bunch and a half.
Marielle -- I didn't know that was default behavior!![Embarassed :oops:](./images/smilies/icon_redface.gif)
I know what to do about the backgrounds now, but I'm still stumped about the fields. The fields I want to scroll with the wheel are locked and list behavior is turned on, so I can't click on them first, as far as I know. If I do, the field script will just direct me to the location referenced by the clickable line.
I'd also like to be able to avoid the extra mouseclick, if possible. I.e., I'd like to designate a given field on a given card as mouse-wheel-able one.
If I may get really picayune, I'd like the designated mouse-wheel-able field on a card to remain the mouse-wheel-able field regardless of where else I click on the card, before I try to scroll the field.
Is this possible? If so, a brief suggestion or two will probably be sufficient.
Thanks again,
Tim
I know you guys from the list! You've always been very supportive. It's nice to see friendly faces, so to speak.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Jeez, maybe I shoulda just used my name for my username instead of some silly alias. I want to be personable. What do you suggest?
Jonathan -- I'm amazed! Your script for scrolling the bg worked perfectly, right out of the box. It usually isn't that easy. Thanks a bunch and a half.
Marielle -- I didn't know that was default behavior!
![Embarassed :oops:](./images/smilies/icon_redface.gif)
I know what to do about the backgrounds now, but I'm still stumped about the fields. The fields I want to scroll with the wheel are locked and list behavior is turned on, so I can't click on them first, as far as I know. If I do, the field script will just direct me to the location referenced by the clickable line.
I'd also like to be able to avoid the extra mouseclick, if possible. I.e., I'd like to designate a given field on a given card as mouse-wheel-able one.
If I may get really picayune, I'd like the designated mouse-wheel-able field on a card to remain the mouse-wheel-able field regardless of where else I click on the card, before I try to scroll the field.
Is this possible? If so, a brief suggestion or two will probably be sufficient.
Thanks again,
Tim
-
- Posts: 11
- Joined: Mon Apr 10, 2006 5:39 pm
It's me again. Oopsie! I figured it out, immediately after inquiring. I shoulda thought about it first more. ![Embarassed :oops:](./images/smilies/icon_redface.gif)
I tried modifiying Jonathan's script thus:
on rawkeydown pKey
if pKey = 65309 then
put the vscroll of BG field "index field" into A
put A - 14 into B
set the vscroll of BG field "index field" to B
else if pKey = 65308 then
put the vscroll of BG field "index field" into A
put A + 14 into B
set the vscroll BG field "index field" to B
else
pass rawkeydown
end if
end rawkeydown
I put it into the script of the card the field resides on. It works great! Question answered. And, in addition, I now have some idea about how to use "on rawkeydown"
Cheers,
Tim
![Embarassed :oops:](./images/smilies/icon_redface.gif)
I tried modifiying Jonathan's script thus:
on rawkeydown pKey
if pKey = 65309 then
put the vscroll of BG field "index field" into A
put A - 14 into B
set the vscroll of BG field "index field" to B
else if pKey = 65308 then
put the vscroll of BG field "index field" into A
put A + 14 into B
set the vscroll BG field "index field" to B
else
pass rawkeydown
end if
end rawkeydown
I put it into the script of the card the field resides on. It works great! Question answered. And, in addition, I now have some idea about how to use "on rawkeydown"
![Smile :)](./images/smilies/icon_smile.gif)
Cheers,
Tim
-
- Livecode Opensource Backer
Hi Tim,blingbling wrote:It's me again. Oopsie! I figured it out, immediately after inquiring. I shoulda thought about it first more.
<snip> It works great! Question answered. And, in addition, I now have some idea about how to use "on rawkeydown"![]()
Glad it worked just fine! Jonathan's script was clearly closer to your needs. Funny how sometimes the fact to write the question help you find the answer
![Wink :wink:](./images/smilies/icon_wink.gif)
-
- Posts: 11
- Joined: Mon Apr 10, 2006 5:39 pm
Both of these scripts seemed to work intermittently.
I eventually realized that no rawkeydown message get sent by the mouse wheel unless the mouse is "within" something -- within the rect of a button or a field. I.e., if there's a mouseEnter message, not followed by a mouseLeave message, the IDE gets a rawkeydown message from the mouse wheel. Otherwise, it doesn't. It doesn't seem to matter whether the mouse is within a cd btn or field, or a bg btn or field.
The mouse remains within the background, and within the rect of the card or stack, but I guess that doesn't count.
I doubt there's any way to get the mouse wheel to scroll the field or background whether or not the mouse is within the rect of a field or button, but I thought I'd ask. Are there any clever tricks available for this situation?
It is inconvenient at times, if I have to "chase" a field or button, keeping the cursor over it, as it scrolls up and down, to keep the mouse wheel working. But it isn't a tragedy.
Cheers,
Tim
I eventually realized that no rawkeydown message get sent by the mouse wheel unless the mouse is "within" something -- within the rect of a button or a field. I.e., if there's a mouseEnter message, not followed by a mouseLeave message, the IDE gets a rawkeydown message from the mouse wheel. Otherwise, it doesn't. It doesn't seem to matter whether the mouse is within a cd btn or field, or a bg btn or field.
The mouse remains within the background, and within the rect of the card or stack, but I guess that doesn't count.
I doubt there's any way to get the mouse wheel to scroll the field or background whether or not the mouse is within the rect of a field or button, but I thought I'd ask. Are there any clever tricks available for this situation?
It is inconvenient at times, if I have to "chase" a field or button, keeping the cursor over it, as it scrolls up and down, to keep the mouse wheel working. But it isn't a tragedy.
Cheers,
Tim
-
- Posts: 22
- Joined: Mon Apr 10, 2006 1:42 pm
- Location: Atlanta
- Contact:
-
- Posts: 22
- Joined: Mon Apr 10, 2006 1:42 pm
- Location: Atlanta
- Contact:
Wait, I see the problem now...
What I do is have an image that is transparent, but still receives mouse messages. (one of the ink settings does this, i forget which one off the top of my head)
This image needs to rest at the bottom layer inside the group. I will try to throw something together for you, and send it to you as an example.
What I do is have an image that is transparent, but still receives mouse messages. (one of the ink settings does this, i forget which one off the top of my head)
This image needs to rest at the bottom layer inside the group. I will try to throw something together for you, and send it to you as an example.
-
- Posts: 22
- Joined: Mon Apr 10, 2006 1:42 pm
- Location: Atlanta
- Contact:
-
- Posts: 11
- Joined: Mon Apr 10, 2006 5:39 pm
mousewheel scrolling, slow update with rawkeydown
I've noticed that only part of the rawkeydown messages get caught. This makes for a strange scrolling behaviour: the faster you use the whell, the slower the scroll. I guess because on fast wheeling lots of messages get lost.JonathanLynch wrote:If you want to scroll a group (background), you need to intercept the rawkeydown message.
Here is the relevant script for a windows system, I assume it works on other systems as well:
on rawkeydown pKey
if pKey = 65309 then
put the vscroll of me into A
put A - 14 into B
set the vscroll of me to B
else if pKey = 65308 then
put the vscroll of me into A
put A + 14 into B
set the vscroll me to B
else
pass rawkeydown
end if
end rawkeydown
Is there any way to change this ? I've tried with "wait" messages and with "flush", with no result.
Where do they go all those lost rawkeydown ?
If I could get those, I could eventually make a nice exponential scroll...
Thanks
Trevix