summaryrefslogtreecommitdiff
path: root/sdl2/events.scm
Commit message (Collapse)AuthorAgeFilesLines
* events: Add support for take-focus and hit-test window events.David Thompson2022-10-091-16/+19
|
* events: Support additional controller buttons.David Thompson2022-10-011-1/+8
|
* events: Add mouse wheel event.David Thompson2021-05-131-0/+40
|
* events: Parse the "repeat" field of a keyboard event as a boolean.David Thompson2017-01-011-4/+4
| | | | | | | | * sdl2/events.scm (<keyboard-event>): Rename "repeat" field to "repeat?" (keyboard-event-repeat): Replace with... (keyboard-event-repeat?): ... this. (parse-keyboard-event): Parse "repeat" field as a boolean.
* events: Add predicates for different controller device events.David Thompson2017-01-011-0/+21
| | | | | * sdl2/events.scm (controller-added-event?, controller-removed-event?, controller-remapped-event?): New procedures.
* events: Reduce allocation in poll-event.David Thompson2016-12-311-42/+47
| | | | | * sdl2/events.scm (poll-event): Reuse the same event structure for each call.
* Add bindings for game controller input.David Thompson2016-12-311-0/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sdl2.scm (%default-init-flags): Add 'joystick' to default flags. (sdl-init): Translate to 'joystick' to SDL2 init bit flag. * sdl2/bindings.scm (SDL_INIT_JOYSTICK, SDL_JOYSTICK_POWER_UNKNOWN, SDL_JOYSTICK_POWER_EMPTY, SDL_JOYSTICK_POWER_LOW, SDL_JOYSTICK_POWER_MEDIUM, SDL_JOYSTICK_POWER_FULL, SDL_JOYSTICK_POWER_WIRED, SDL_JOYSTICK_POWER_MAX, SDL_CONTROLLER_AXIS_INVALID, SDL_CONTROLLER_AXIS_LEFTX, SDL_CONTROLLER_AXIS_LEFTY, SDL_CONTROLLER_AXIS_RIGHTX, SDL_CONTROLLER_AXIS_RIGHTY, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_CONTROLLER_AXIS_MAX, SDL_CONTROLLER_BUTTON_INVALID, SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_BACK, SDL_CONTROLLER_BUTTON_GUIDE, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_LEFTSTICK, SDL_CONTROLLER_BUTTON_RIGHTSTICK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, SDL_CONTROLLER_BUTTON_DPAD_UP, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_MAX): New variables. (sdl-joystick-open, sdl-joystick-close, sdl-joystick-current-power-level, sdl-joystick-event-state, sdl-joystick-from-instance-id, sdl-joystick-get-attached, sdl-joystick-get-axis, sdl-joystick-get-ball, sdl-joystick-get-button, sdl-joystick-get-device-guid, sdl-joystick-get-guide, sdl-joystick-get-guid-from-string, sdl-joystick-get-guid-string, sdl-joystick-get-hat, sdl-joystick-instance-id, sdl-joystick-name, sdl-joystick-name-for-index, sdl-joystick-num-axes, sdl-joystick-num-balls, sdl-joystick-num-buttons, sdl-joystick-num-hats, sdl-num-joysticks, sdl-joystick-update, sdl-game-controller-add-mapping, sdl-game-controller-open, sdl-game-controller-close, sdl-game-controller-event-state, sdl-game-controller-from-instance-id, sdl-game-controller-get-attached, sdl-game-controller-get-axis, sdl-game-controller-get-axis-from-string, sdl-game-controller-get-string-from-axis, sdl-game-controller-get-string-for-axis, sdl-game-controller-get-button, sdl-game-controller-get-button-from-string, sdl-game-controller-get-string-from-button, sdl-game-controller-get-joystick, sdl-game-controller-mapping, sdl-game-controller-mapping-for-guid, sdl-game-controller-name, sdl-game-controller-name-for-index, sdl-game-controller-update, sdl-is-game-controller): New procedures. * sdl2/events.scm (make-joystick-ball-event, joystick-ball-event?, joystick-ball-event-timestamp, joystick-ball-event-which, joystick-ball-event-ball, joystick-ball-event-x-rel, joystick-ball-event-y-rel, make-joystick-hat-event, joystick-hat-event?, joystick-hat-event-timestamp, joystick-hat-event-which, joystick-hat-event-hat, joystick-hat-event-value, make-joystick-device-event, joystick-device-event?, joystick-device-event-timestamp, joystick-device-event-which, joystick-device-event-action, make-controller-axis-event, controller-axis-event?, controller-axis-event-timestamp, controller-axis-event-which, controller-axis-event-axis, controller-axis-event-value, make-controller-button-event, controller-button-event?, controller-button-down-event?, controller-button-up-event?, controller-button-event-timestamp, controller-button-event-which, controller-button-event-button, controller-button-event-pressed?, make-controller-device-event, controller-device-event?, controller-device-event-timestamp, controller-device-event-which, controller-device-event-action, parse-joystick-ball-event, parse-joystick-hat-event, parse-joystick-device-event, parse-controller-axis-event, parse-controller-button-event, parse-controller-device-event): New procedures. (poll-event): Parse joystick/controller events. * sdl2/input/joystick.scm: New file. * sdl2/input/game-controller.scm: New file. * Makefile.am (SOURCES): Add them
* Add bindings for text input event handling.David Thompson2016-12-301-1/+31
| | | | | | | | | | | * sdl2/bindings.scm (sdl-start-text-input, sdl-stop-text-input, sdl-is-text-input-active): New procedures. * sdl2/events.scm (<text-input-event>): New record type. (make-text-input-event, text-input-event?, text-input-event-timestamp, text-input-event-window-id, text-input-event-text, parse-text-input-event): New procedures. * sdl2/input/text.scm: New file. * Makefile.am (SOURCES): Add it.
* events: window: Change vector from pair to list.David Thompson2015-12-211-2/+2
| | | | | | | This is consistent with representing coordinate pairs as lists elsewhere in the library. * sdl2/events.scm (parse-window-event): Change vector from pair to list.
* events: window: Add additional predicates.David Thompson2015-12-211-0/+84
| | | | | | | | | * sdl2/events.scm (window-shown-event?, window-hidden-event?, window-exposed-event?, window-moved-event?, window-resized-event?, window-size-changed-event?, window-minimized-event?, window-maximized-event?, window-restored-event?, window-enter-event?, window-leave-event?, window-focus-gained-event?, window-focus-lost-event?, window-closed-event?): New procedures.
* events: Add quit event.David Thompson2015-12-211-1/+22
| | | | | | | * sdl2/events.scm (<quit-event>): New record type. (make-quit-event, quit-event?, quit-event-timestamp, parse-quit-event): New procedures. (poll-event): Add support for SDL_QUIT events.
* events: keyboard: Correct exported symbols.David Thompson2015-12-211-1/+3
| | | | | | | | | Exported the wrong symbol for the key symbol, and forgot to export symbols for selecting scancode and modifiers. * sdl2/events.scm: Remove export to nonexistent keyboard-event-keysym. Export keyboard-event-key, keyboard-event-scancode, and keyboard-event-modifiers.
* events: joystick: Add button bindings.David Thompson2015-12-161-0/+45
| | | | | | | | | | * sdl2/events.scm (<joystick-button-event>): New record type. (make-joystick-button-event, joystick-button-event?, joystick-button-down-event?, joystick-button-up-event?, joystick-button-event-timestamp, joystick-button-event-which, joystick-button-event-button, joystick-button-event-pressed?, parse-joystick-button-event): New procedures. (poll-event): Add support for joystick button events.
* events: joystick: Add axis motion bindings.David Thompson2015-12-161-0/+38
| | | | | | | | | * sdl2/events.scm (<joystick-axis-event>): New record type. (make-joystick-axis-event, joystick-axis-event?, joystick-axis-event-timestamp, joystick-axis-event-which, joystick-axis-event-axis, joystick-axis-event-value, parse-joystick-axis-event): New procedures. (poll-event): Add support for joystick axis motion events.
* events: mouse: Add motion event bindings.David Thompson2015-12-161-0/+59
| | | | | | | | | | | | * sdl2/bindings.scm (button-mask): New procedure. (SDL_BUTTON_LMASK, SDL_BUTTON_RMASK, SDL_BUTTON_MMASK, SDL_BUTTON_X1MASK, SDL_BUTTON_X2MASK): New variables. * sdl2/events.scm (<mouse-motion-event>): New record type. (make-mouse-motion-event mouse-motion-event?, mouse-motion-event-timestamp, mouse-motion-event-window-id, mouse-motion-event-which, mouse-motion-event-buttons, mouse-motion-event-x, mouse-motion-event-y, mouse-motion-event-x-rel, mouse-motion-event-y-rel, parse-mouse-motion-event): New procedures.
* events: window: Fix parse-window-event.David Thompson2015-12-161-1/+1
| | | | | | Good ol' fencepost error strikes again. * sdl2/events.scm (parse-window-event): Fix off-by-1 error.
* events: keyboard: Add additional predicates.David Thompson2015-12-161-0/+12
| | | | * sdl2/events.scm (keyboard-down-event?, keyboard-up-event?): New procedures.
* events: Add mouse button event bindings.David Thompson2015-12-161-0/+70
| | | | | | | | | | | | | * sdl2/bindings.scm (SDL_BUTTON_LEFT, SDL_BUTTON_RIGHT, SDL_BUTTON_MIDDLE, SDL_BUTTON_X1, SDL_BUTTON_X2): New variables. * sdl2/events.scm (<mouse-button-event>): New record type. (make-mouse-button-event, mouse-button-event?, mouse-button-down-event?, mouse-button-up-event?, mouse-button-event-timestamp, mouse-button-event-window-id, mouse-button-event-which, mouse-button-event-button, mouse-button-event-pressed?, mouse-button-event-clicks, mouse-button-event-x, parse-mouse-button-event): New procedures. (poll-event): Add support for mouse button events.
* Add event bindings.David Thompson2015-12-161-0/+673
So far, only window and keyboard events are handled. More to come in future patches. This patch adds a *ton* of constants that I'm not going to mention in this log because it would be too damn long. * sdl2/bindings.scm (sdl-poll-event): New procedure. * sdl2/events.scm: New file. * Makefile.am (SOURCES): Add it.