我正在尝试在我的 Seesaw 框架上收听 :key-pressed 和 :key-released 事件,但这些事件没有触发。我已将问题缩小到列表框——当列表框存在时,框架不再捕获关键事件。这是我的代码的简化版本,显示了该行为:
(ns ainur.example
(:use seesaw.core))
(let [lst (listbox :model ["Chiptune" "Sinewave"])
f (frame :title "Ainur"
:on-close :exit
:size [1024 :by 768]
:content (border-panel :hgap 10 :vgap 10
:center (label "Center")
:north (label "North")
:south (label "South")
:west lst))]
(listen lst :selection (fn [e]
(let [active-inst (selection e)]
(println active-inst))))
(listen f
:key-pressed (fn [e]
(println "Key pressed"))
:key-released (fn [e]
(println "Key released")))
(invoke-later
(native!)
(show! f)))
谁能帮我弄清楚为什么没有触发关键事件?任何帮助将非常感激。提前致谢!