WheelUpDown - GetKeyState, A_EventInfo

Discuss the future of the AutoHotkey language
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

WheelUpDown - GetKeyState, A_EventInfo

08 Aug 2018, 02:26

Continued from here.
[b][color=#FF0000]lexikos[/color][/b] wrote:using GetKeyState to retrieve the last wheel delta value is a good idea. v2-alpha removes all other uses of A_EventInfo, so if this is done, A_EventInfo can be removed.
Alternative, pass the wheel delta as parameter to the hotkey callback. Then you couldn't use a label if you wanted the wheel delta ofc. Or, just rename A_EventInfo to A_WheelDelta. (I prefer the first)
WheelUp is not a key or button and doesn't have any state, so what are you expecting
I'd expect an exception, since it should be considered invalid input for the reasons in the quote. Maybe there are other reasons it shouldn't?

Cheers.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: WheelUpDown - GetKeyState, A_EventInfo

08 Aug 2018, 21:02

Hotkey callbacks currently do not receive parameters because hotkeys are typically written directly, and cannot receive parameters. One can write a function hotkey, but it is more verbose and requires assigning a unique name to the hotkey. Once parameters come into play, I suppose that we must consider other potential parameters (such as those that have meaning to all hotkeys).

The nature of my question was more along the lines of "why would anyone care what this does" or "why are you even passing this value in the first place", and was asked to the OP in the context of v1.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: DuyMinh and 23 guests