no mouse-wheel event when shift key is down (shift+mouse-wheel events?)

守給你的承諾、 提交于 2019-12-06 04:37:14

问题


I'm trying to manage some events in lisp with lispbuilder-sdl.

Thus far I got this.

;; Load package :
(ql:quickload "lispbuilder-sdl")

;; main definition:
(defun main (argv)
  (defparameter *ticks* 0)
  (sdl:with-init ()
    (sdl:window 100 100 :title-caption "test")
    (sdl:with-events ()
      (setf (sdl:frame-rate) 60)
      (:quit-event () (progn (sdl:quit-image) (exit) t))
      (:mouse-button-down-event 
       (:button button :x x :y y)
       (format t "~&LSHIFT: ~a RSHIFT: ~a BUTTON: ~a X: ~d Y: ~d" 
               (sdl:get-key-state :sdl-key-lshift) 
               (sdl:get-key-state :sdl-key-rshift) 
               button x y))
      (:key-down-event 
       (:key key)
       (format t "~& KEY: ~a" key))
      (:idle ()))))



;; Entrypoint :
(sb-int:with-float-traps-masked (:invalid :inexact :overflow) (main *posix-argv*))

If I launch this, a window appear, I can click and roll, I got an output to describe the state of the keys and buttons pressed. Same if I press a key down. Fine.

But something weird occurs when I keep a shift key down.

If I do so, I still have the output when clicking. But not when rolling (mouse wheel events).

So I guess mouse-wheel events simply arent triggered when a shift (right or left) is down. But only shift keys, and I don't even know why.

So I can't for instance handle shift+mouse-wheel events.

Any idea?

NB : The version of SBCL I use on OSX is 1.2.11 but it works with both 1.3.2 and 1.2.11 on Ubuntu.

来源:https://stackoverflow.com/questions/35578933/no-mouse-wheel-event-when-shift-key-is-down-shiftmouse-wheel-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!