I really liked the keyboard support that someone added to hierarchy lists. Unfortunately, it appears to be broken with a recent set of updates.
Smalltalk explore
press the down arrow key, boom!
Also, when it was working, the left-arrow should was redundant with the up arrow. One thing I *do* like about eclipse is, when navigating it's enormous hierarchies via keyboard, you can use the left-arrow to go to the parent of the currently selected node. Left again closes it. Right opens it.
Thanks, Chris
Try changing the last line in ObjectExplorer>>explorerKey:from: from
^ self arrowKey: aChar from: view
to
^ view arrowKey: aChar
Cheers, - Andreas
----- Original Message ----- From: "Chris Muller" afunkyobject@yahoo.com To: "Squeak List" squeak-dev@lists.squeakfoundation.org Sent: Tuesday, June 29, 2004 8:30 AM Subject: [BUG] SimpleHierarchicalListMorph does not understand#getCurrentSelectionIndex
I really liked the keyboard support that someone added to hierarchy lists. Unfortunately, it appears to be broken with a recent set of updates.
Smalltalk explore
press the down arrow key, boom!
Also, when it was working, the left-arrow should was redundant with the up arrow. One thing I *do* like about eclipse is, when navigating it's
enormous
hierarchies via keyboard, you can use the left-arrow to go to the parent
of the
currently selected node. Left again closes it. Right opens it.
Thanks, Chris
On Tuesday 29 June 2004 10:39 am, Andreas Raab wrote:
Try changing the last line in ObjectExplorer>>explorerKey:from: from
^ self arrowKey: aChar from: view
to
^ view arrowKey: aChar
Of course, this brings up the question of why the callbacks work differently in the PluggableListMorph, (versus the SimpleHierarchicalListMorph, and the PluggableListView).
In the PLM, the model is NEVER called for any un-modified arrow keys, just for keys with modifiers (shift, alt, command, control?). The model never hears about keys whose asciiValue is < 32.
Browser(Model)>>arrowKey:from: [...] PluggableListMorph>>modifierKeyPressed: model perform: keystrokeActionSelector with: aChar with: self PluggableListMorph>>keyStroke: | aChar aSpecialKey | (self scrollByKeyboard: event) ifTrue: [^self]. aChar _ event keyCharacter. aSpecialKey _ aChar asciiValue. aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey]. (event anyModifierKeyPressed or: [self handlesBasicKeys not]) ifTrue: [^ self modifierKeyPressed: aChar]. ^ self basicKeyPressed: aChar
So none of the code in Model>>arrowKey: is ever executed from the PLM.
It could be moved into PLV and replaced with an empty method. It should *really* be called something like #commandKey: instead.
In the SHLM and the PLV, the model is always called if it set a keystrokeSelector. Which means that if you want to get a real arrow key action, you have to call *back* to the SHLM...
ObjectExplorer>>explorerKey:from: SimpleHierarchicalListMorph>>keyStroke: | args aCharacter | (self scrollByKeyboard: event) ifTrue: [^self]. aCharacter := event keyCharacter. keystrokeActionSelector isNil ifTrue: [^self arrowKey: aCharacter]. ^model perform: keystrokeActionSelector with: aCharacter.
Stay tuned for a fix...
Ned,
I disagree - if a key stroke selector has been set it should be called no matter what and the client (model) is then responsible to call #arrowKey: if it wants to. That's because otherwise you've got a heck of a time (subclassing an arbitrary number of classes) if you ever want to be able to have "non-standard" responses to arrow keys.
Cheers, - Andreas
----- Original Message ----- From: "Ned Konz" ned@bike-nomad.com To: squeak-dev@lists.squeakfoundation.org Cc: chris@funkyobjects.org; "Andreas Raab" andreas.raab@gmx.de Sent: Tuesday, June 29, 2004 3:01 PM Subject: Re: [BUG] SimpleHierarchicalListMorph does notunderstand#getCurrentSelectionIndex
On Tuesday 29 June 2004 10:39 am, Andreas Raab wrote:
Try changing the last line in ObjectExplorer>>explorerKey:from: from
^ self arrowKey: aChar from: view
to
^ view arrowKey: aChar
Of course, this brings up the question of why the callbacks work
differently
in the PluggableListMorph, (versus the SimpleHierarchicalListMorph, and
the
PluggableListView).
In the PLM, the model is NEVER called for any un-modified arrow keys, just
for
keys with modifiers (shift, alt, command, control?). The model never hears about keys whose asciiValue is < 32.
Browser(Model)>>arrowKey:from: [...] PluggableListMorph>>modifierKeyPressed: model perform: keystrokeActionSelector with: aChar with: self PluggableListMorph>>keyStroke: | aChar aSpecialKey | (self scrollByKeyboard: event) ifTrue: [^self]. aChar _ event keyCharacter. aSpecialKey _ aChar asciiValue. aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey]. (event anyModifierKeyPressed or: [self handlesBasicKeys not]) ifTrue: [^ self modifierKeyPressed: aChar]. ^ self basicKeyPressed: aChar
So none of the code in Model>>arrowKey: is ever executed from the PLM.
It could be moved into PLV and replaced with an empty method. It should *really* be called something like #commandKey: instead.
In the SHLM and the PLV, the model is always called if it set a keystrokeSelector. Which means that if you want to get a real arrow key action, you have to call *back* to the SHLM...
ObjectExplorer>>explorerKey:from: SimpleHierarchicalListMorph>>keyStroke: | args aCharacter | (self scrollByKeyboard: event) ifTrue: [^self]. aCharacter := event keyCharacter. keystrokeActionSelector isNil ifTrue: [^self arrowKey: aCharacter]. ^model perform: keystrokeActionSelector with: aCharacter.
Stay tuned for a fix...
Ned Konz http://bike-nomad.com
On Tuesday 29 June 2004 3:28 pm, Andreas Raab wrote:
I disagree - if a key stroke selector has been set it should be called no matter what and the client (model) is then responsible to call #arrowKey: if it wants to. That's because otherwise you've got a heck of a time (subclassing an arbitrary number of classes) if you ever want to be able to have "non-standard" responses to arrow keys.
That makes sense to me, too.
However, you didn't do it that way when you wrote PluggableListMorph>>
keyStroke: event "Process keys specialKeys are things like up, down, etc. ALWAYS HANDLED modifierKeys are regular characters either 1) accompanied with ctrl, cmd or 2) any character if the list doesn't want to handle basic keys (handlesBasicKeys returns false) basicKeys are any characters" | aChar aSpecialKey | (self scrollByKeyboard: event) ifTrue: [^self]. aChar _ event keyCharacter. aSpecialKey _ aChar asciiValue. aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey]. (event anyModifierKeyPressed or: [self handlesBasicKeys not]) ifTrue: [^ self modifierKeyPressed: aChar]. ^ self basicKeyPressed: aChar
The first time your code looks at the keystrokeActionSelector is in modifierKeyPressed:.
Did you have a change of heart?
However, you didn't do it that way when you wrote PluggableListMorph>>
Then we should consider this a bug and fix it :-)
Cheers, - Andreas
----- Original Message ----- From: "Ned Konz" ned@bike-nomad.com To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Tuesday, June 29, 2004 3:49 PM Subject: Re: [BUG] SimpleHierarchicalListMorph doesnotunderstand#getCurrentSelectionIndex
On Tuesday 29 June 2004 3:28 pm, Andreas Raab wrote:
I disagree - if a key stroke selector has been set it should be called
no
matter what and the client (model) is then responsible to call
#arrowKey:
if it wants to. That's because otherwise you've got a heck of a time (subclassing an arbitrary number of classes) if you ever want to be able
to
have "non-standard" responses to arrow keys.
That makes sense to me, too.
However, you didn't do it that way when you wrote PluggableListMorph>>
keyStroke: event "Process keys specialKeys are things like up, down, etc. ALWAYS HANDLED modifierKeys are regular characters either 1) accompanied with ctrl, cmd or 2) any character if the list doesn't want to handle basic keys (handlesBasicKeys returns false) basicKeys are any characters" | aChar aSpecialKey | (self scrollByKeyboard: event) ifTrue: [^self]. aChar _ event keyCharacter. aSpecialKey _ aChar asciiValue. aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey]. (event anyModifierKeyPressed or: [self handlesBasicKeys not]) ifTrue: [^ self modifierKeyPressed: aChar]. ^ self basicKeyPressed: aChar
The first time your code looks at the keystrokeActionSelector is in modifierKeyPressed:.
Did you have a change of heart?
-- Ned Konz http://bike-nomad.com
This change works ok for me in a 3.7gamma #5978 image.
Regards.
gsa.
Andreas Raab wrote:
Try changing the last line in ObjectExplorer>>explorerKey:from: from
^ self arrowKey: aChar from: view
to
^ view arrowKey: aChar
Cheers,
- Andreas
----- Original Message ----- From: "Chris Muller" afunkyobject@yahoo.com To: "Squeak List" squeak-dev@lists.squeakfoundation.org Sent: Tuesday, June 29, 2004 8:30 AM Subject: [BUG] SimpleHierarchicalListMorph does not understand#getCurrentSelectionIndex
I really liked the keyboard support that someone added to hierarchy lists. Unfortunately, it appears to be broken with a recent set of updates.
Smalltalk explore
press the down arrow key, boom!
Also, when it was working, the left-arrow should was redundant with the up arrow. One thing I *do* like about eclipse is, when navigating it's
enormous
hierarchies via keyboard, you can use the left-arrow to go to the parent
of the
currently selected node. Left again closes it. Right opens it.
Thanks, Chris
squeak-dev@lists.squeakfoundation.org