Forum

> > CS2D > Scripts > addbind scroll?
Forums overviewCS2D overview Scripts overviewLog in to reply

English addbind scroll?

7 replies
To the start Previous 1 Next To the start

old addbind scroll?

Quattro
GAME BANNED Off Offline

Quote
Why this doesn't work?

1
2
3
4
5
6
7
8
9
addbind('mwheelup')
addhook("key","button_press")


function button_press(id,key,state)
    if key == 'mwheelup' then
        msg('success')
    end
end

old Re: addbind scroll?

Edik
User Off Offline

Quote
dont forget to ask the state:
1
2
3
4
5
6
addbind("mwheelup")
function button_press(id,key,state)
    if key == "mwheelup" and state == 0 then
        msg("success")
    end
end
edited 1×, last 14.08.18 10:35:02 pm

old Re: addbind scroll?

Cure Pikachu
User Off Offline

Quote
I used this to debug:
1
2
3
4
5
6
7
addbind("mwheelup")
addbind("mwheeldown")

addhook("key","button_press")
function button_press(id,key,state)
	msg(key.." "..state)
end
With this you expect some output when you scroll, but nope, got nothing. And yes, the documentation considers them valid.
cs2d lua cmd addbind has written
Valid key names:
...
• Mouse: "mouse1" (left click), "mouse2" (right click), "mouse3" (middle click), "mwheelup", "mwheeldown" (scrolling)

old Re: addbind scroll?

SQ
Moderator Off Offline

Quote
@user Quattro: It seems I didn't added it and documentation is incorrect.
Probably it's that.
edited 1×, last 18.08.18 06:16:51 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview