indexing description: "[ Joystick axis event ]" date: "$Date$" revision: "$Revision$" class EM_JOYSTICK_AXIS_EVENT inherit EM_EVENT redefine out, make, type end create make feature {NONE} -- Initialization make (a_pointer: POINTER) is -- Create an joystick axis event. do Precursor (a_pointer) create sdl_joystick_axis_event_struct.make_shared (a_pointer) end -- /* Joystick axis motion event structure */ -- typedef struct SDL_JoyAxisEvent { -- Uint8 type; /* SDL_JOYAXISMOTION */ -- Uint8 which; /* The joystick device index */ -- Uint8 axis; /* The joystick axis index */ -- Sint16 value; /* The axis value (range: -32768 to 32767) */ -- } SDL_JoyAxisEvent; feature -- Queries type: INTEGER is -- Event type value -- (`em_key_down_event' or `em_key_up_event') do result := em_joystick_axis_event end is_device: INTEGER is -- From which joystick device did this event come? do result := sdl_joystick_axis_event_struct.which end is_axis: INTEGER is -- From which axis did this event come? do result := sdl_joystick_axis_event_struct.axis end value: INTEGER is -- return the current value of the respective axis -- in this event -- The value range is between -32768 and 32767 (16bit INTEGER) do result := sdl_joystick_axis_event_struct.value end feature -- Output out: STRING is -- Textual representation do -- Result := "EM_JOYSTICK_AXIS_EVENT" -- -- if is_key_down then -- result := result + " button down" -- elseif is_key_up then -- result := result + " button up" -- end -- -- result := result + " (" + is_button.out + ")" end feature {NONE} -- Implementation sdl_joystick_axis_event_struct: SDL_JOY_AXIS_EVENT_STRUCT -- Wrapped struct containing informatiuon about the joystick event. invariant sdl_joystick_axis_event_struct_not_void: sdl_joystick_axis_event_struct /= Void end