comparison docs/html/guideinput.html @ 181:e5bc29de3f0a

Updated from the SDL Documentation Project
author Sam Lantinga <slouken@libsdl.org>
date Fri, 14 Sep 2001 02:41:09 +0000
parents 55f1f1b3e27d
children 355632dca928
comparison
equal deleted inserted replaced
180:578815880307 181:e5bc29de3f0a
434 ><A 434 ><A
435 NAME="AEN214" 435 NAME="AEN214"
436 >Advanced Joystick Functions</A 436 >Advanced Joystick Functions</A
437 ></H2 437 ></H2
438 ><P 438 ><P
439 >That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis we a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:</P 439 >That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:</P
440 ><DIV 440 ><DIV
441 CLASS="EXAMPLE" 441 CLASS="EXAMPLE"
442 ><A 442 ><A
443 NAME="AEN217" 443 NAME="AEN217"
444 ></A 444 ></A
567 >Example 3-8. Joystick Hat Events</B 567 >Example 3-8. Joystick Hat Events</B
568 ></P 568 ></P
569 ><PRE 569 ><PRE
570 CLASS="PROGRAMLISTING" 570 CLASS="PROGRAMLISTING"
571 > case SDL_JOYHATMOTION: /* Handle Hat Motion */ 571 > case SDL_JOYHATMOTION: /* Handle Hat Motion */
572 if ( event.jhat.hat | SDL_HAT_UP ) 572 if ( event.jhat.hat &#38; SDL_HAT_UP )
573 { 573 {
574 /* Do up stuff here */ 574 /* Do up stuff here */
575 } 575 }
576 576
577 if ( event.jhat.hat | SDL_HAT_LEFT ) 577 if ( event.jhat.hat &#38; SDL_HAT_LEFT )
578 { 578 {
579 /* Do left stuff here */ 579 /* Do left stuff here */
580 } 580 }
581 581
582 if ( event.jhat.hat | SDL_HAT_RIGHTDOWN ) 582 if ( event.jhat.hat &#38; SDL_HAT_RIGHTDOWN )
583 { 583 {
584 /* Do right and down together stuff here */ 584 /* Do right and down together stuff here */
585 } 585 }
586 break;</PRE 586 break;</PRE
587 ></DIV 587 ></DIV