Keyboard, Mouse, Joystick

In this lesson, we'll be taking control of object using our keyboard, mouse and joystick. And I'm not going to cover everything about those sensors and the actuators cuz you'll come to know what each event does.

Keyboard Sensor

Keyboard sensor

From previous lessons, you've learned how the basics of how to use the keyboard. If not lemme tell how you: add a keyboard sensor, press the field near Key you'll be asked to press a key, do it and connect a sensor. Now your actuator must be activated that is connected by the keyboard sensor when u trigger the keyboard sensor.

All Keys

If you select All Keys, the actuator gets triggered whenever you press any button on your keyboard.

First Modifier

Used for making key combinations, let's say if you have Key: Left Shift and First Modifier: Left Ctrl, The actuator is triggered when you press Left Shift+Left Ctrl.

Second Modifier

Same as First Modifier but creates addition key combination. Let's say if you keep the Second Modifier as Left Alt your actuator is triggered when you press Left Shift+Left Ctrl+Left Alt. Comes in handy fr.

Log Toggle

Decides whether you want your keystrokes to be logged in a property. Setting your property to True allows you to log them and vice versa for False.

Target

Asks on which property you want the keystrokes to be logged. This can be used to create cheats like thing for your game. still confused af? Download the project file and examine it or ask in the discord server. Oh you can refer the docs too.

Mouse Sensor

Mouse Sensor
Left Button

Triggered when you press left mouse button.

Right Button

Triggered when you press right mouse button.

Middle Button

Triggered when you press right middle button which is used for scrolling.

Wheel Up

Triggered when you scroll you scrolling wheel up.

Wheel Down

Triggered when you scroll you scrolling wheel down.

Movement

Used to detect the movement of the mouse. Can use this event to do FPS setup.

Mouse Over

Triggered when you hover your mouse cursor on the object which has the mouse sensor.

Mouse Over Any

Triggered when you hover your mouse cursor on object that has that specified property or a material. Enabling X-Ray helps you to see through objects. Masking helps you to mask the collision objects. Here, download the project file bro.

Extra buttons

Events like Button 6, Button 7, Right Thumb Button and Left Thumb Button is for mouses that have extra buttons like the one below.

Extra mouse buttons

Joystick Sensor

Joystick sensor

Joystick Index can be used with multiple joysticks. Index 0 stands for joystick one. Threshold minimum when the stick is moved. The more the threshold is, the less chances an event is triggered when the stick is moved.

Buttons

These are used for the buttons like, A, B, X, Y, etc. for Xbox. You can also use the playstation controllers too.

Information printed in a Windows Console about joystick
Shoulder Triggers

This the button we press with our middle finger, decides whether the trigger should be left or right.

Stick Axis

Trigger an event when the stick goes in horizontal or vertical axis. It can be the left stick or the right stick.

Stick Direction

Trigger an event when the stick goes in a certain direction. It can be the left stick or the right stick.

Download the project file.

Mouse Actuator

Mouse Actuator

Mode has two modes. Visibility and Look.

Visibility

Sets the visibility of the mouse cursor. When the button is highlighted, the cursor is visible when the game runs. Vice versa when the button is grayed out.

Look

Makes the object look around accordingly when you move the mouse cursor. Well explained here.

Vibration Actuator

*testing*