I'm trying to listen to the :key-pressed and :key-released events on my Seesaw frame, but the events aren't firing. I've narrowed the problem down to a listbox -- when the listbox is present, the frame no longer captures the key events. Here's a simplified version of my code that shows the behavior:
(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)))
Can anyone help me figure out why the key events aren't triggered? Any help would be really appreciated. Thanks in advance!