[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] UnicodeResponder KeyCodeResponder keyDownBubbling with modifiers



Hoi Felix,

here is a little issue i'm having with your (until now very useful) key-responders. The responders unfortunately cannot distinguish _fully_ between a normal and a modified keyDown. In the example below, i want that the key pressed with the ctrl- modifier down bubbles the action up to SCTopView, thus returning nil. What it does it returns a responder-stack and nothing happens. Would you have any elegant fix for this?

(
k = UnicodeResponder.new;
//  control ;
k.register(   59  ,   false, false, false, true, {
	"hi from TopView".postln;
});

l = UnicodeResponder.new;
//  ;
l.register(   59  ,   false, false, false, false, {
	"hi from Slider".postln;
});

w = SCWindow.new.front;
w.view.keyDownAction_(k);
v = SCSlider.new(w,Rect(10,10,100,100));
v.keyDownAction_(l);
v.focus;

)

Btw. ' tried the same with the KeyCodeResponder.

cheers,
Jan