when using the GAwizard, there are different effects when using Drag&Drop depending on whether or not the shift-key is pressed.
I would like to use this functionality as well, but couldn't figure out how to do it. Understandably the tools/methods of the GAwizard are locked...
Can anyone tell me, how these different behaviours depending on the shift (or possibly another) key can be achieved?
Thanks in advance.
Solved! Go to Solution.
Not herd of this feature before so did a bit of digging around.... looks like they use an undocumented function to do this which is why you cant find out anything about it.
getAsyncKeyState(16) >= 0
The above line is what they do to check, if it returns false then shift key is pressed, if its true then shift key is not pressed.
I am quite interested now into how this method works and how it could be programed for other keyboard buttons and what does its return value mean (i got -32768 for left shift and -32767 for right shift and 0 for everything else tested).
Also interested in how many other undocumented functions there is and how we would learn about them (apart from poking our nose into code that we shouldn't...).
thank you for your solution.
It works, even though I don't really understand how it works.
Would be interesting to get some documentation on how to check for different keys.
This can be done with an undocumented function (basically, Windows). To check if the Shift-key is pressed, the following should work:
if getAsyncKeyState(16) < 0 then --Shift is pressed end
Use 17 for the Ctrl-key, 18 for Alt.
This function gives you direct access to the corresponding Windows function which is documented here:
Was just about to drop that link here for people.
This one might also be interesting as it states what numbers to use for different keys, just got to convert the hex to decimal for plant sim.