Sciss/SwingOSC — Issue #17: Text downs not swallowed by TextView
Author: Sciss
Created: 2012-03-09 15:55:05+00:00
State: open
Labels: Bug

[via james harkins]:

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!).