In Fuzize , to sense keyboard inputs, you need to use a condition code, what is checking, is the button in our keyboard pressed, or not, and what will happen if it will be pressed. That is very easy. Let me show
1. \\program:=keyboardinputs\..
2. \\log:=1\..
3.
4. STRT
5.
6. ALWAYS
7.
8. if.(enter.key=pressed=true)thando:=
9. write:=('ENTER pressed!');
10. elsedo:=
11. write:=("");
12.
13. noSTP
14.
15. STP
Now, the text, " ENTER pressed! " will only be shown if the enter key pressed. That is what the condition if.(enter.key=pressed=true) checking. If it's not pressed, than the text will be " ". Simple program, what help us learning Fuzize !
Today we made a program, that is showing a text "ENTER pressed!", when the enter key is pressed on the keyboard. If it's not, than the text, what is shown is empty.
The program shows a text "ENTER pressed!" if the enter key on the keyboard is pressed. It also checks the situation, when the key isn't clicked, and than it shows the text " ".
If you want to make a condition with an other input from your keyboard, or your other hardver input, you can do that, with naming that. Usually that is works like this in the next example:
1. \\program:=mouseinputs\..
2. \\log:=1\..
3.
4. STRT
5.
6. ALWAYS
7.
8. if.(lmouse.trig=clicked=true)thando:=
9. write:=('Left mouse clicked!');
10. elsedo:=
11. write:=("");
12.
13. noSTP
14.
15. STP
In this situation, the program is checking the mouse, what is hardware, what is also having (two) input. This input is not a key, so we can't use simply the .key code, we had to use the .trig code, what is the abridgement of trigger. But that trick is also useful in case, we have a consol.
1. \\program:=gamepadinputs\..
2. \\log:=1\..
3.
4. STRT
5.
6. ALWAYS
7.
8. if.(A.trig=pressed=true)thando:=
9. write:=('A button pressed!');
10. elsedo:=
11. write:=("");
12.
13. noSTP
14.
15. STP
As you can see now, if you have a simple gamepad, with an A button, (like in case of an Xbox controller,) you can check it's buttons behaviors.