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

Re: [sc-dev] Sc3 keydown functions proposal



> i was just going to ask where you were with this since
> i'm looking even in sc2 for this kind of cascading.

one week holiday away from any telephone line.

> but i just realized that it is smarter to return nil if you want it to
> bubble up.

good point. I wasn't really satisfied with this. I would also like to have
something that still allows not returning a boolean, so that you get default
bubbling style if not returning true. I just didn't find any .isBoolean
testing.

 
> if(pass && this.isKindOf(SCTopView).not, {
> // call local keydown action of parent view
> this.parent.handleKeyDownBubbling(view, key, modifiers);
> 
> you should just override handleKeyDownBubbling in SCTopView to pass it
> then to the globalKeyDown action.

Well, I like the idea that the global action is seperate from the usual
passing and is always called. I'm not shure if this is what you're aiming
at?

> i guess these keyboards can detect up to 4 keys at once.  did you find
> anything
> about that ?

You are talking about usual keys not modifiers, are you? I didn't know about
that. I didn't go into this, only know about what was there in the NS
framework: just one key + modifiers there.
 
>> The keyUp is handed over the exact same way. There is a difference
>> though:
>> keyUp sets the variable keyTyped to the released key.
>> And as keyDowns keep repeating with the key repeat rate you set in
>> global os
>> preferences (you can even turn repetition off if you want) keyUp appears
>> only once.
> hmm.  so you would have in your keydown action something that waits for
> the keyUp
> to appear ?

I don't get your point here. Maybe you have to run it first. Apart from
repetition its exactly the keydown thing.

> my KeyDown uses a dictionary so it doesn't have to ask a lot of if
> statements.

looks really promising to me. Nice code...

> if you are going to write handlers, then take a look at this KeyDown
> code and steal.

yeah thanks, I will

    Heiko