Im trying to work with Lua, specifically inside the scripting of my Logitech G-Series Profiler software but that's Lua true enough.
I have a function that I've written in AHK, and it works fine.
But considering it uses ControlGetFocus and SendMessage I'm rather lost on how to convert this script into a Lua script.
Anyone else here familiar with Lua?
Right now, I've got the "G-Series profiler" converting
mouseButton4(aka rightTiltWheel) to Lua_f22, and
mouseButton5(aka leftTiltWheel) to Lua_f23.
then this AHK script below intercepts the f22 or f23 keypress and converts it into RightScroll and LeftScroll accordingly, using sendmessage
but that's pretty round-about don't you think??
"G-Series profiler" lacks any simple constant for Left and Right scrolling. It also doesn't auto repeat messages such as "VScrolling". So it seemed to get any 'repeating' options it was best to repeat a f22/f23 key. but reeeealy its just a mess to convert it 3 times... Isn't there a way to just do SendMessage, 0x114, ~~~ in Lua?
Don't punch me in the noobLua for askin! *^p^*
Code: Select all
#NoEnv
#NoTrayIcon
#KeyHistory 0
#MaxMem 1
#Persistent
hscrl(r=0) {
ControlGetFocus, fcontrol, A
SendMessage, 0x114, %r%, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINERIGHT. or the 0 after it is SB_LINELEFT.
}
f22::
hscrl(0)
return
f23::
hscrl(1)
return