[[tags: allegro game]]
== allegro
This document pertains to user input related methods found in the Allegro egg.
Please see the main [allegro] wiki page for more information.
[[toc:]]
== Constants
* joystick-max-axes
* jostick-max-sticks
* joystick-max-buttons
* mouse-max-extra-axis
== Enums
=== cursor-type
(cursor-type->int cursor-type)
{{cursor-type}} may be one of the following symbols:
* none
* default
* arrow
* busy
* question
* edit
* move
* resize-north
* resize-west
* resize-south
* resize-east
* resize-northwest
* resize-southwest
* resize-southeast
* resize-northeast
* progress
* precision
* link
* alt-select
* unavailable
(int->cursor-type integer)
=== joystick-flag
(joystick-flag->int joystick-flag)
{{joystick-flag}} may be one of the following symbols:
* digital
* analog
(int->joystick-flag integer)
=== key
(key->int key)
{{key}} may be one of the following symbols:
* a
* b
* c
* d
* e
* f
* g
* h
* i
* j
* k
* l
* m
* n
* o
* p
* q
* r
* s
* t
* u
* v
* w
* x
* y
* z
* one
* two
* three
* four
* five
* six
* seven
* eight
* nine
* zero
* pad-one
* pad-two
* pad-three
* pad-four
* pad-five
* pad-six
* pad-seven
* pad-eight
* pad-nine
* pad-zerp
* f1
* f2
* f3
* f4
* f5
* f6
* f7
* f9
* f9
* f10
* f11
* f12
* escape
* tilde
* minus
* equals
* backspace
* tab
* openbrace
* enter
* semicolon
* quote
* backslash
* backslash2
* comma
* fullstop
* slash
* space
* insert
* delete
* home
* end
* pgup
* pgdn
* left
* right
* up
* down
* pad-slash
* pad-asterisk
* pad-minus
* pad-plus
* pad-delete
* pad-enter
* printscreen
* pause
* abnt-c1
* yen
* kana
* convert
* noconvert
* at
* circumflex
* colon2
* kanji
* pad-equals
* backquote
* semicolon2
* command
* unknown
* lshift
* rshift
* lctrl
* rctrl
* alt
* altgr
* lwin
* rwin
* menu
* scrolllock
* numlock
* capslock
(int->key integer)
=== keymod
(keymod->int keymod)
{{keymod}} may be one of the following symbols:
* shift
* ctrl
* alt
* lwin
* rwin
* menu
* altgr
* command
* scrolllock
* numlock
* capslock
* inaltseq
* accent1
* accent2
* accent3
* accent4
(int->keymod integer)
== Records
=== cursor
cursor
=== joystick
joystick
=== joystick-state
joystick-state
(make-joystick-state*)
(make-joystick-state)
(free-joystick-state! joystick-state)
(joystick-state-button int)
=== keyboard
keyboard
=== keyboard-state
keyboard-state
(make-keyboard-state*)
(make-keyboard-state)
(free-keyboard-state! keyboard-state)
(keyboard-state-display)
=== mouse
mouse
=== mouse-cursor
mouse-cursor
=== mouse-state
mouse-state
(make-mouse-state)
(make-mouse-state*)
(free-mouse-state! mouse-state)
(mouse-state-x mouse-state)
(mouse-state-y mouse-state)
(mouse-state-z mouse-state)
(mouse-state-w mouse-state)
(mouse-state-buttons mouse-state)
(mouse-state-pressure mouse-state)
(mouse-state-axis mouse-state integer)
(mouse-state-display mouse-state)
== Functions
=== Joystick
(joystick-addon-install)
Implements al_install_joystick.
(joystick-addon-uninstall)
Implements al_uninstall_joystick.
(joystick-addon-installed?)
Implements al_is_joystick_installed.
(joystick-addon-reconfigure)
Implements al_reconfigure_joysticks.
(joystick-event-source)
Implements al_get_joystick_event_source.
(joystick-count)
Implements al_get_num_joysticks.
(joystick-ref integer)
Implements al_get_joystick.
(joystick-release joystick)
Implements al_release_joystick.
(joystick-active? joystick)
Implements al_get_joystick_active.
(joystick-name joystick)
Implements al_get_joystick_name.
(joystick-axes-count joystick (integer stick))
Implements al_get_joystick_num_axes.
(joystick-button-count joystick)
Implements al_get_joystick_num_buttons.
(joystick-button-name joystick (integer button))
Implements al_get_joystick_button_name.
(joystick-state-init! joystick-state joystick)
Implements al_get_joystick_state.
(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
(keyboard-addon-installed?)
Implements al_is_keyboard_installed.
(keyboard-addon-install)
Implements al_install_keyboard.
(keyboard-addon-uninstall)
Implements al_uninstall_keyboard.
(keycode->string key)
Implements al_keycode_to_name. Not strictly necessary, since the enums are symbols which can easily be converted to strings.
(keyboard-event-source)
Implements al_get_keyboard_event_source.
(keyboard-led-set! integer)
Implements al_set_keyboard_leds.
(keyboard-state-init! keyboard-state)
Implements al_get_keyboard_state.
(keyboard-state-key-down? keyboard-state key)
Implements al_key_down.
(keyboard-three-finger-flag?)
Wraps _al_three_finger_flag.
(keyboard-led-flag?)
Wraps _al_key_led_flag.
=== Mouse
(mouse-addon-installed?)
Implements al_is_mouse_installed.
(mouse-addon-install)
Implements al_install_mouse.
(mouse-addon-uninstall)
Implements al_uninstall_mouse.
(mouse-button-count)
Implements al_get_mouse_num_buttons.
(mouse-axes-count)
Implements al_get_mouse_num_axes.
(mouse-xy-set! display (integer x) (integer y))
Implements al_set_mouse_xy.
(mouse-z-set! display integer)
Implements al_set_mouse_z.
(mouse-w-set! display integer)
Implements al_set_mouse_w.
(mouse-event-source)
Implements al_get_mouse_event_source.
(mouse-state-init! mouse-state)(mouse-state-button-down mouse-state (integer button))
Implements al_mouse_button_down.
(mouse-state-axis mouse-state (integer axis))
Implements al_get_mouse_state_axis.
(mouse-axis-set! (integer axis) (integer value))
Implements al_set_mouse_axis.
(make-cursor* (bitmap sprite) (integer xfocus) (integer yfocus))
Implements al_create_mouse_cursor.
(make-cursor (bitmap sprite) (integer xfocus) (integer yfocus))
Implements al_create_mouse_cursor, with (free-cursor!) declared as a finalizer.
(free-cursor! cursor)
Implements al_destroy_mouse_cursor.
(mouse-cursor-position)
Returns a 2-element list consisting of the x and y position of the mouse cursor.
(mouse-ungrab)
Implements al_ungrab_mouse.
(display-grab-mouse! display)
Implements al_grab_mouse.
(display-cursor-set! display mouse-cursor)
Implements al_set_mouse_cursor.
(display-hide-cursor! display)
Implements al_hide_mouse_cursor.
(display-system-mouse-cursor-set! display cursor-type)
Implements al_set_system_mouse_cursor.