Forum

> > CS2D > Scripts > addbind scroll?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch addbind scroll?

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt addbind scroll?

Quattro
GAME BANNED Off Offline

Zitieren
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

alt Re: addbind scroll?

Edik
User Off Offline

Zitieren
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
1× editiert, zuletzt 14.08.18 22:35:02

alt Re: addbind scroll?

Cure Pikachu
User Off Offline

Zitieren
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 hat geschrieben
Valid key names:
...
• Mouse: "mouse1" (left click), "mouse2" (right click), "mouse3" (middle click), "mwheelup", "mwheeldown" (scrolling)

alt Re: addbind scroll?

SQ
Moderator Off Offline

Zitieren
@user Quattro: It seems I didn't added it and documentation is incorrect.
Probably it's that.
1× editiert, zuletzt 18.08.18 06:16:51
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht