Page 1 of 1

Scroll wheel behavior and rawkeyUp

Posted: Tue Apr 17, 2012 6:53 pm
by jmburnod
Hi All,

Is there a way to have an equivalent of rawkeyUp for 65309 and 65308 (the mousewheel) ?
User contributed notes from dictionary
use the rawKeyDown handler instead of this one as the scroll wheel does not generate rawKeyUp messages.
Best regards

Jean-Marc

Re: Scroll wheel behavior and rawkeyUp

Posted: Tue Apr 17, 2012 7:03 pm
by dunbarx
Jean-Marc.

What do you mean? This?

Code: Select all

on mouseup
   send "rawkeydown 65309" to this cd
end mouseup
Where in the card script:

Code: Select all

on rawkeydown tKey
   put random(99)
end rawkeydown
So when you scroll the wheel you get a bunch of random numbers , and when you click the button that contains the first script you get another. What do you want to do?

Craig Newman

Re: Scroll wheel behavior and rawkeyUp

Posted: Tue Apr 17, 2012 7:11 pm
by mwieder
Like the user note says, use the rawKeyDown message to handle it:

Code: Select all

on rawKeyDown pKeyCode
    local tIncrement
    local tScroll

    -- wheel up,down,left,right
    if pKeyCode is among the items of 65308,65309 then
        put trunc(0.10 * the height of me) into tIncrement
        switch pKeyCode
            case 65308 
                put the scroll of me into tScroll
                add tIncrement to tScroll
                set the scroll of me to tScroll
                break
            case 65309 
                put the scroll of me into tScroll
                subtract tIncrement from tScroll
                set the scroll of me to tScroll
                break
        end switch
        exit rawKeyDown
    end if
    pass rawKeyDown
end rawKeyDown

Re: Scroll wheel behavior and rawkeyUp

Posted: Tue Apr 17, 2012 9:47 pm
by jmburnod
Hi,
Thanks for reply.

Sorry my explanation is not clear. the mousewheel work fine but i need to catch the end of the rawkeyDown message to adjust the vscroll (when it stop between 2 images).

I have found a temporary way with a mouseleave on the script of the control

Best regards

Jean-Marc