/Tukui/modules/chat/mousescroll.lua
http://github.com/Asphyxia/Tukui · Lua · 27 lines · 22 code · 2 blank · 3 comment · 8 complexity · 34c1c9a5e2156d98cbb8108535b0f457 MD5 · raw file
- local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
- if C["chat"].enable ~= true then return end
- ------------------------------------------------------------------------
- -- Enhance/rewrite a Blizzard feature, chatframe mousewheel.
- ------------------------------------------------------------------------
- local ScrollLines = 3 -- set the jump when a scroll is done !
- function FloatingChatFrame_OnMouseScroll(self, delta)
- if delta < 0 then
- if IsShiftKeyDown() then
- self:ScrollToBottom()
- else
- for i = 1, ScrollLines do
- self:ScrollDown()
- end
- end
- elseif delta > 0 then
- if IsShiftKeyDown() then
- self:ScrollToTop()
- else
- for i = 1, ScrollLines do
- self:ScrollUp()
- end
- end
- end
- end