anchor.diff:  (in-package #:sdl2)
   
  -(defsanecenum-from-cenum (event-type
  -                          sdl2-ffi:sdl-eventtype
  -                          "SDL-"))
  +(defsanecenum-from-cenum (event-type sdl2-ffi:sdl-eventtype "SDL-"))
   
   (defun add-event-struct-slots (event-slots)
     (let ((hash-table (make-hash-table)))
  
positive.code:   (let ((enum-value (foreign-slot-value event-ptr 'sdl2-ffi:sdl-event 'type)))
      (foreign-enum-keyword 'event-type enum-value)))
  
  (defun get-event-struct (event-ptr)
    (let ((event-type (get-event-type event-ptr)))
      (foreign-slot-value event-ptr 'sdl2-ffi:sdl-event (gethash event-type *event-struct-slots*))))
  
  (defun get-event-data (event-ptr)
    (let* ((event-struct (get-event-struct event-ptr))
           (event-struct-type (intern
                               (format nil "SDL-~a" (get-event-type event-ptr))
                               'sdl2-ffi))
           (slot-names (foreign-slot-names event-struct-type)))
      (mapcan #'list
              (mapcar #'alexandria:make-keyword slot-names)
              (loop for slot-name in slot-names
                 collect
                   (foreign-slot-value event-struct event-struct-type slot-name)))))
  
  (defun next-event (event-ptr &optional (method :poll) (timeout 1))
    "Method can be either :poll, :wait, or :wait-with-timeout"
  
negative.code:        do (setf (gethash event-type hash-table) slot-name))
      hash-table))
  
  (defvar *event-struct-data*
    (add-event-struct-slots
     (list (list :controlleraxismotion
                 (list 'sdl2-ffi::caxis
                       'sdl2-ffi::sdl-controlleraxisevent))
           (list :controllerbuttonup
                 (list 'sdl2-ffi::cbutton
                       'sdl2-ffi::sdl-controllerbuttonevent))
           (list :controllerbuttondown
                 (list 'sdl2-ffi::cbutton
                       'sdl2-ffi::sdl-controllerbuttonevent))
           (list :controllerdeviceremoved
                 (list 'sdl2-ffi::cdevice
                       'sdl2-ffi::sdl-controllerdeviceevent))
           (list :controllerdeviceremapped
                 (list 'sdl2-ffi::cdevice
                       'sdl2-ffi::sdl-controllerdeviceevent))
           (list :controllerdeviceadded
                 (list 'sdl2-ffi::cdevice
                       'sdl2-ffi::sdl-controllerdeviceevent))
           (list :joyaxismotion
                 (list 'sdl2-ffi::jaxis
                       'sdl2-ffi::sdl-joyaxisevent))
           (list :joyballmotion
                 (list 'sdl2-ffi::jball
                       'sdl2-ffi::sdl-joyballevent))
           (list :joyhatmotion
                 (list 'sdl2-ffi::jhat
                       'sdl2-ffi::sdl-joyhatevent))
           (list :joybuttonup
                 (list 'sdl2-ffi::jbutton
                       'sdl2-ffi::sdl-joybuttonevent))
           (list :joybuttondown
                 (list 'sdl2-ffi::jbutton
                       'sdl2-ffi::sdl-joybuttonevent))
           (list :joydeviceadded
                 (list 'sdl2-ffi::jdevice
                       'sdl2-ffi::sdl-joydeviceevent))
           (list :joydeviceremoved
                 (list 'sdl2-ffi::jdevice
                       'sdl2-ffi::sdl-joydeviceevent))
           (list :keyup
                 (list 'sdl2-ffi::key
                       'sdl2-ffi::sdl-keyboardevent))
           (list :keydown
                 (list 'sdl2-ffi::key
                       'sdl2-ffi::sdl-keyboardevent))
           (list :mousewheel
                 (list 'sdl2-ffi::wheel
                       'sdl2-ffi::sdl-mousewheelevent))
           (list :mousebuttonup
                 (list 'sdl2-ffi::button
                       'sdl2-ffi::sdl-mousebuttonevent))
           (list :mousebuttondown
                 (list 'sdl2-ffi::button
                       'sdl2-ffi::sdl-mousebuttonevent))
           (list :mousemotion
                 (list 'sdl2-ffi::motion
                       'sdl2-ffi::sdl-mousemotionevent))
           (list :userevent
                 (list 'sdl2-ffi::user
                       'sdl2-ffi::sdl-userevent))
           (list :windowevent
                 (list 'sdl2-ffi::window
                       'sdl2-ffi::sdl-windowevent))
           (list :quit
                 (list 'sdl2-ffi::quit
                       'sdl2-ffi::sdl-quitevent)))))
  
  (defun new-event (&optional (event-type :firstevent))
    (let ((enum-value (foreign-enum-value 'event-type event-type))
  