Oxygen Basic
Programming => Example Code => Topic started by: Peter on December 10, 2011, 01:44:38 PM
-
Deleted
-
Thank you Peter,
I have put in bit masks for GetAsyncKeyState: 0x8001 as per MSDN spec.
There are quite a few changes. Is it safe to resynchronise all the examples to this new library?
Charles
-
Hi Peter in one program, I forget which, higher bits were set causing a false keypress.
Setting the return type of GetAsyncKeyState to short instead of integer may help
-
...WINXP hasn't 64 Bit, is too old therefor. ... :D
Sorry, but this is not true: Microsoft released Windows XP in 64 bit.
Here more information:
http://en.wikipedia.org/wiki/Windows_XP_Professional_x64_Edition
bye
-
According to Microsoft GetAsyncKeyState returns SHORT.
SHORT WINAPI GetAsyncKeyState(
__in int vKey
);
Everything else is wrong!
-
Yes, I ran a number of tests and found various high bits were set in 64 bit mode (Vista 64bit).
If you change the return type for GetAsyncKeyState to short, the compiler will sign-extend the 16 bits to 64 bits as it should, and the high bits will be overwritten.
Then there is no need to apply a bitmask. (Still needed if using MinWin)
I checked this with 'FileTest' and without this modification the program locks into a loop
Charles
PS: This does not apply to your libraries Peter but I had to make an adjustment for functions returning shorts or bytes, treated as booleans thus:
while GetAsyncKeyState(27)
wend
while not GetAsyncKeyState(27)
wend
On my latest update now, this mode of expression will work correctly for 64 bit binaries.
-
Hi Peter,
Discussing problem areas like this is beneficial from my point of view, as they often indicate where Oxygen needs further attention.
-
I do not know why we discuss about key usage, only we both got it. On the other side, no interest here!
The people expect OxygenBasic as divine ability, that makes their programs.
Peter,
Oxygen is young, so the objective must be to build a set of include files that work in conjunction with the OS-API.
(according to our best knowledge...)
Doing otherwise is just foolish and short sighted.
There is no reason to get mad about it...
Stay cool 8)