[Swingosc-devel] keydown bubbling bug: textview --> top-level parent
Brought to you by:
sciss
From: James H. <jam...@gm...> - 2012-03-09 15:41:08
|
Hi, A student of mine found a key down bubbling bug. w = Window.new; c = CompositeView(w, Rect(2, 2, 300, 300)).background_(Color.yellow) .keyDownAction_({ |view, key| key.debug("compositeview keyaction") }); t = TextView(c, Rect(2, 2, 296, 296)); w.view.keyDownAction = { |view, key| key.debug("window view keyaction") }; w.front; As far as I know (and this is the behavior in QtGui), the text view should swallow the keydowns and none of the parents should get the keydowns. For some reason, here, the immediate parent does not get the keydown, but the top level parent does. It cropped up as an issue in Hadron because it looks for shift-H as a help key in a plug-in's window. Some of the plug-ins use a text view for code entry, and this issue means it's impossible to type a capital H in the text view without opening help (and in SC3.4, this crashes SuperCollider!). I'll remove the help key from my fork of Hadron, but this is a discrepancy in behavior that probably should be fixed sometime. hjh -- James Harkins /// dewdrop world jam...@de... http://www.dewdrop-world.net "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks |