indexing description: "[ Mouse button event ]" date: "$Date$" revision: "$Revision$" class EM_MOUSEBUTTON_EVENT inherit EM_MOUSE_EVENT redefine make, type end create make feature {NONE} -- Initialization make (a_pointer: POINTER) is -- Create a mouse button event. do create sdl_mousebutton_event_struct.make_shared (a_pointer) Precursor (a_pointer) end feature -- Access screen_x: INTEGER is -- X-coordinate of pointer position on screen where the mouse event has occured do Result := sdl_mousebutton_event_struct.x end screen_y: INTEGER is -- Y-Coordinate of pointer position on screen where the mouse event has occured do Result := sdl_mousebutton_event_struct.y end type: INTEGER is -- Event type value -- (`Em_mouse_button_down_event' or `em_mouse_button_up_event') do Result := sdl_mousebutton_event_struct.type end button: INTEGER is -- Number of the button that has been pressed or released do Result := sdl_mousebutton_event_struct.button end feature -- Status report is_button_down: BOOLEAN is -- Is it a button down event? do Result := (type = Em_mouse_button_down_event) end is_button_up: BOOLEAN is -- Is it a button up event? do Result := (type = Em_mouse_button_up_event) end is_left_button: BOOLEAN is -- Has the left button been pressed or released? do Result := (button = 1) end is_middle_button: BOOLEAN is -- Has the middle button been pressed or released? do Result := (button = 2) end is_right_button: BOOLEAN is -- Has the right button been pressed or released? do Result := (button = 3) end is_mouse_wheel_up: BOOLEAN is -- Has the mouse wheel been moved up? do Result := (button = 4) end is_mouse_wheel_down: BOOLEAN is -- Has the mouse wheel been moved down? do Result := (button = 5) end button_state: INTEGER is -- Mouse button state specifying which mouse buttons are currently pressed -- (see mouse_button_xxx_flag features for possible flags) do Result := sdl_mousebutton_event_struct.state end feature {NONE} -- Implementation sdl_mousebutton_event_struct: SDL_MOUSE_BUTTON_EVENT_STRUCT -- The struct invariant sdl_mousebutton_event_struct_not_void: sdl_mousebutton_event_struct /= Void end