Source code: org/libsdl/event/SDLJoyHatEvent.java
1
2
3 package org.libsdl.event;
4
5 /**
6 * The <code>SDLJoyHatEvent</code> represents a joystick hat position
7 * event.
8 * <p>
9 *
10 * @author Eric Wittmann
11 * @version $revision$
12 */
13 public class SDLJoyHatEvent extends SDLEvent
14 {
15 private short which;
16 private short hat;
17 private short value;
18
19 /**
20 * Constructs a new <code>SDLJoyHatEvent</code> with the given type,
21 * which, hat, and value parameters.
22 * @param type Short - type of joystick hat position event
23 * @param which Short - the which
24 * @param hat Short - the hat
25 * @param value Short - the value
26 */
27 public SDLJoyHatEvent(short type, short which, short hat, short value) {
28 super(SDLEvent.SDL_JOYHATMOTION, type);
29 this.which = which;
30 this.hat = hat;
31 this.value = value;
32 }
33
34 /**
35 * Return the 'which' of this joystick hat position event.
36 * @return Short - the 'which'
37 */
38 public short getWhich() {
39 return which;
40 }
41
42 /**
43 * Return the hat of this joystick hat position event.
44 * @return Short - the hat
45 */
46 public short getHat() {
47 return hat;
48 }
49
50 /**
51 * Return the value of this joystick hat position event.
52 * @return Short - the value
53 */
54 public short getValue() {
55 return value;
56 }
57 }