Difference between revisions of "Modules/input/Usage"

From MSX Game Library

< Modules‎ | input

(Blanked the page)
Line 1: Line 1:
 
+
Check joystick bouton example:
 +
<syntaxhighlight lang="c">
 +
u8 joy = Joystick_Read(JOY_PORT_1);
 +
if (joy & JOY_INPUT_TRIGGER_A)
 +
// Joystick A boutton pressed
 +
else if (joy & JOY_INPUT_TRIGGER_B)
 +
// Joystick B boutton pressed
 +
</syntaxhighlight>

Revision as of 23:07, 7 January 2024

Check joystick bouton example:

u8 joy = Joystick_Read(JOY_PORT_1);
if (joy & JOY_INPUT_TRIGGER_A)
// Joystick A boutton pressed
else if (joy & JOY_INPUT_TRIGGER_B)
// Joystick B boutton pressed