• allegro5.a5_display
  • allegro5.a5_file
  • allegro5.a5_font
  • allegro5.a5_image
  • allegro5.a5_joystick
  • allegro5.a5_main
  • allegro5.a5_misc
  • allegro5.a5_opengl
  • allegro5.a5_shader
  • allegro5.a5_sound
  • allegro5.a5_thread
  • allegro5.a5_triangles
  • animation
  • array
  • atlas
  • buffer
  • color
  • common
  • csg.csg_aabb
  • csg.csg
  • csg.csg_octree
  • csg.csg_shapes
  • csg.csg_test
  • data
  • display
  • exception
  • file
  • font
  • glsl
  • grid
  • hash
  • image
  • image_op
  • index
  • ini
  • isometric
  • joystick
  • keyboard
  • land
  • layer
  • list
  • log
  • main
  • map
  • mem
  • mouse
  • net
  • noise
  • openglutil
  • perlin
  • pixelmask
  • plasma
  • pool
  • protobuf
  • queue
  • random
  • runner
  • shader
  • sound
  • sprite
  • thread
  • tilegrid
  • triangles
  • util2d
  • util3d
  • util
  • view
  • voronoi
  • widget.base
  • widget.board
  • widget.book
  • widget.box
  • widget.button
  • widget.checkbox
  • widget.container
  • widget.edit
  • widget.gul
  • widget.hbox
  • widget.layout
  • widget
  • widget.menu
  • widget.mover
  • widget.panel
  • widget.scrollbar
  • widget.scrolling
  • widget.sizer
  • widget.slider
  • widget.spin
  • widget.text
  • widget.theme
  • widget.vbox
  • widget.widget_list
  • yaml.external
  • yaml.internal
  • yaml
  • yaml.xml

land.mouse

0 is the left mouse button 1 is the right mouse button 2 is the middle mouse button 3,4,… are extra mouse buttons

A button is either pressed or not. And it either changed since the last time or not. The old API gives us 4 possibilities:

00 not pressed and was not 01 just pressed (was not in last tick) 10 just released (not pressed but was last tick) 11 being held down

However, this will not work with clicks that happen “between” two ticks:

tick 0 1 2 3 4 mouse D U D U D U

In the above case the 4 ticks will have: 1: 01 (just pressed, correct) 2: 10 (just released) Completely ignores the click in between 3: 00 (nothing) Completely ignores the click 4: 00

There is no good way to solve this with this API. If clicks are detected as 01 (react as soon as pressed) then we should return this: 1: 01 2: 01 (there was a click after all) 3: 01 (same) 4: 10

This would capture all 3 clicks but would see only one if they are detected as 10.

If clicks are detected as 10 (react when the button is released): 1: 01 (so no click yet) 2: 10 (we lose the really fast click, which would still be fine) 3: 10 (there was a click) 4: 00

This would capture 2 of the 3 clicks (which is fine, we can never detect more than one click per tick). But it would only detect one click if detected as 01.

Both of those solutions also make it so the previous tick state could differ from the actual one, possibly messing up drag&drop code and so on if not prepared for it.

One stop-gap measure we do employ is if there is just one fast click with no click before, we create both a fake 01 and fake 10.

tick 0 1 2 3 4 D U

1: 00 2: 01 (fake, but not really) 3: 10 (to go with it) 4: 00

land_mouse_init

no parameters

land_mouse_tick

no parameters

land_mouse_move_event

Parameters: int x, int y, int z

land_touch_event

Parameters: float x, float y, int n, int d

land_touch_x

Parameters: int n

Returns: float

land_touch_y

Parameters: int n

Returns: float

land_touch_down

Parameters: int n

Returns: bool

land_touch_delta

Parameters: int n

Returns: bool

land_mouse_button_down_event

Parameters: int b

land_mouse_button_up_event

Parameters: int b

land_mouse_x

no parameters

Returns: int

Return the mouse X coordinate for the current tick.

land_mouse_y

no parameters

Returns: int

Return the mouse Y coordinate for the current tick.

land_mouse_z

no parameters

Returns: int

Return the mouse wheel coordinate for the current tick.

land_mouse_b

no parameters

Returns: int

deprecated

land_mouse_button

Parameters: int i

Returns: int

Return the mouse button state for the current tick.

land_mouse_delta_x

no parameters

Returns: int

land_mouse_delta_y

no parameters

Returns: int

land_mouse_delta_z

no parameters

Returns: int

land_mouse_delta_b

no parameters

Returns: int

deprecated

land_mouse_delta_button

Parameters: int i

Returns: int

land_mouse_button_clicked

Parameters: int i

Returns: int

land_mouse_button_released

Parameters: int i

Returns: int

land_mouse_set_pos

Parameters: int x, int y

land_hide_mouse_cursor

no parameters

Returns: bool

land_show_mouse_cursor

no parameters

Returns: bool


Generated: Thu 27 Feb 2020 10:49:37 PM EST