Sorry i was under the impression that i already replyed.
When you are in the IDE and type in KeyboardPushed(...
You see at the bottom line the short explenation of using the function.
And that says: KeyboardPushed(KeyID) Returns a 1 if the assinged key is pressed. otherwise 0.
So you may think that the pressing of the key, gives you a 1 like #True. But i got a 128 value returned.
That put me on the wrong foot. When i try to write some code and you see the bottom line. you make up the wrong code.
Now i know that the last bit is set and not the first i can work with that. Every key give back a 128 value (Bit#7 is a 1). This is easy to convert to a 1 value (Bit #0 is a 1)
By making a procedure testing the key and give back the value i need.
Thanks guy's
From my first self made computer till now I stil like computers.
bfernhout wrote:You see at the bottom line the short explenation of using the function.
And that says: KeyboardPushed(KeyID) Returns a 1 if the assinged key is pressed. otherwise 0.
Oh, bottom line = status bar of the IDE. Yes, it says something different to the Help. Now I get what you mean.
Thanks for the post.
It is something that can bring new people on the wrong foot.
Still this is the best way to make programs. If I make the same program in C++, then they are alway larger and slower. I talk about say Purebasic run a program on 300 ms and the compiled and optimized c++ runs on a avarage of 380 ms.
Only when i make the program in Assembler the compiling create a smaller program and run faster.
But then again PB is beter and easyer to program.
From my first self made computer till now I stil like computers.