allegro

This document pertains to user input related methods found in the Allegro egg.

Please see the main [allegro] wiki page for more information.

  1. allegro
  2. Constants
  3. Enums
    1. cursor-type
    2. joystick-flag
    3. key
    4. keymod
  4. Records
    1. cursor
    2. joystick
    3. joystick-state
    4. keyboard
    5. keyboard-state
    6. mouse
    7. mouse-cursor
    8. mouse-state
  5. Functions
    1. Joystick
    2. Keyboard
    3. Mouse

Constants

Enums

cursor-type

[procedure] (cursor-type->int cursor-type)

cursor-type may be one of the following symbols:

[procedure] (int->cursor-type integer)

joystick-flag

[procedure] (joystick-flag->int joystick-flag)

joystick-flag may be one of the following symbols:

[procedure] (int->joystick-flag integer)

key

[procedure] (key->int key)

key may be one of the following symbols:

[procedure] (int->key integer)

keymod

[procedure] (keymod->int keymod)

keymod may be one of the following symbols:

[procedure] (int->keymod integer)

Records

cursor

[record] cursor

joystick

[record] joystick

joystick-state

[record] joystick-state
[procedure] (make-joystick-state*)
[procedure] (make-joystick-state)
[procedure] (free-joystick-state! joystick-state)
[procedure] (joystick-state-button int)

keyboard

[record] keyboard

keyboard-state

[record] keyboard-state
[procedure] (make-keyboard-state*)
[procedure] (make-keyboard-state)
[procedure] (free-keyboard-state! keyboard-state)
[procedure] (keyboard-state-display)

mouse

[record] mouse

mouse-cursor

[record] mouse-cursor

mouse-state

[record] mouse-state
[procedure] (make-mouse-state)
[procedure] (make-mouse-state*)
[procedure] (free-mouse-state! mouse-state)
[procedure] (mouse-state-x mouse-state)
[procedure] (mouse-state-y mouse-state)
[procedure] (mouse-state-z mouse-state)
[procedure] (mouse-state-w mouse-state)
[procedure] (mouse-state-buttons mouse-state)
[procedure] (mouse-state-pressure mouse-state)
[procedure] (mouse-state-axis mouse-state integer)
[procedure] (mouse-state-display mouse-state)

Functions

Joystick

[procedure] (joystick-addon-install)

Implements al_install_joystick.

[procedure] (joystick-addon-uninstall)

Implements al_uninstall_joystick.

<procedure>(joystick-addon-installed?)<procedure>

Implements al_is_joystick_installed.

[procedure] (joystick-addon-reconfigure)

Implements al_reconfigure_joysticks.

<procedure>(joystick-event-source)<procedure>

Implements al_get_joystick_event_source.

[procedure] (joystick-count)

Implements al_get_num_joysticks.

[procedure] (joystick-ref integer)

Implements al_get_joystick.

[procedure] (joystick-release joystick)

Implements al_release_joystick.

[procedure] (joystick-active? joystick)

Implements al_get_joystick_active.

[procedure] (joystick-name joystick)

Implements al_get_joystick_name.

[procedure] (joystick-axes-count joystick (integer stick))

Implements al_get_joystick_num_axes.

[procedure] (joystick-button-count joystick)

Implements al_get_joystick_num_buttons.

[procedure] (joystick-button-name joystick (integer button))

Implements al_get_joystick_button_name.

[procedure] (joystick-state-init! joystick-state joystick)

Implements al_get_joystick_state.

[procedure] (joystick-state-axis joystick-state (integer stick) (integer axis))

Retrieves desired axis value for a particular stick; #f if either stick or axis is out of available bounds.

Keyboard

[procedure] (keyboard-addon-installed?)

Implements al_is_keyboard_installed.

[procedure] (keyboard-addon-install)

Implements al_install_keyboard.

[procedure] (keyboard-addon-uninstall)

Implements al_uninstall_keyboard.

[procedure] (keycode->string key)

Implements al_keycode_to_name. Not strictly necessary, since the enums are symbols which can easily be converted to strings.

[procedure] (keyboard-event-source)

Implements al_get_keyboard_event_source.

[procedure] (keyboard-led-set! integer)

Implements al_set_keyboard_leds.

[procedure] (keyboard-state-init! keyboard-state)

Implements al_get_keyboard_state.

[procedure] (keyboard-state-key-down? keyboard-state key)

Implements al_key_down.

[procedure] (keyboard-three-finger-flag?)

Wraps _al_three_finger_flag.

[procedure] (keyboard-led-flag?)

Wraps _al_key_led_flag.

Mouse

[procedure] (mouse-addon-installed?)

Implements al_is_mouse_installed.

[procedure] (mouse-addon-install)

Implements al_install_mouse.

[procedure] (mouse-addon-uninstall)

Implements al_uninstall_mouse.

[procedure] (mouse-button-count)

Implements al_get_mouse_num_buttons.

[procedure] (mouse-axes-count)

Implements al_get_mouse_num_axes.

[procedure] (mouse-xy-set! display (integer x) (integer y))

Implements al_set_mouse_xy.

[procedure] (mouse-z-set! display integer)

Implements al_set_mouse_z.

[procedure] (mouse-w-set! display integer)

Implements al_set_mouse_w.

[procedure] (mouse-event-source)

Implements al_get_mouse_event_source.

<procedure>(mouse-state-init! mouse-state)</procedure.

Implements al_get_mouse_state.

[procedure] (mouse-state-button-down mouse-state (integer button))

Implements al_mouse_button_down.

[procedure] (mouse-state-axis mouse-state (integer axis))

Implements al_get_mouse_state_axis.

[procedure] (mouse-axis-set! (integer axis) (integer value))

Implements al_set_mouse_axis.

[procedure] (make-cursor* (bitmap sprite) (integer xfocus) (integer yfocus))

Implements al_create_mouse_cursor.

[procedure] (make-cursor (bitmap sprite) (integer xfocus) (integer yfocus))

Implements al_create_mouse_cursor, with (free-cursor!) declared as a finalizer.

[procedure] (free-cursor! cursor)

Implements al_destroy_mouse_cursor.

[procedure] (mouse-cursor-position)

Returns a 2-element list consisting of the x and y position of the mouse cursor.

[procedure] (mouse-ungrab)

Implements al_ungrab_mouse.

[procedure] (display-grab-mouse! display)

Implements al_grab_mouse.

[procedure] (display-cursor-set! display mouse-cursor)

Implements al_set_mouse_cursor.

[procedure] (display-hide-cursor! display)

Implements al_hide_mouse_cursor.

[procedure] (display-system-mouse-cursor-set! display cursor-type)

Implements al_set_system_mouse_cursor.