focus setting

classic Classic list List threaded Threaded
4 messages Options
Werner Kassens Werner Kassens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

focus setting

Hi,
in Pharo 1.2 i could tab through the submorphs using tab and shift-tab.
in Pharo 1.3 shift-tab seems not to work anymore. what can i use to move
backwards through the morphs to set the focus?
werner

S Krish S Krish
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: focus setting

bug in your copy of the image.. possibly.. 

shift-tab seems to work fine for me over most variants I have worked.. just hacked to also include tab windows through ctrl+tab.. which is actually missing.. capability.. when you want to cycle through windows within pharo

Morph>>tabKey: event 
"Check for tab key activity and change focus as appropriate."
event controlKeyPressed
ifFalse: [event keyCharacter = Character tab
ifTrue: [event commandKeyPressed
ifTrue: [World tabOpenWindows: event].
event shiftPressed
ifTrue: [self navigateFocusBackward]
ifFalse: [self navigateFocusForward].
^ true]].
^ false
PasteUpMorph>>
keyStroke: anEvent 
...
anEvent keyCharacter == Character tab
ifTrue: [self tabAmongFields
ifTrue: [ 
anEvent  commandKeyPressed
ifTrue: [^ self tabOpenWindows: anEvent].
...

tabOpenWindows: aKeyboardEvent 
| currentFocus index |
currentFocus := aKeyboardEvent hand keyboardFocus.
SystemWindow noteTopWindowIn: self.
SystemWindow topWindow sendToBack. " could actually raise the next window to top rather"


On Tue, Jan 31, 2012 at 6:53 PM, Werner Kassens <[hidden email]> wrote:
Hi,
in Pharo 1.2 i could tab through the submorphs using tab and shift-tab. in Pharo 1.3 shift-tab seems not to work anymore. what can i use to move backwards through the morphs to set the focus?
werner


Werner Kassens Werner Kassens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: focus setting

> bug in your copy of the image.. possibly..

i just downloaded another Pharo 1.3, used one of the examples in the
unchanged image and got the same result.
i then made a descendant of StandardWindow with
handlesKeyboard: evt
^true
and:
keyStroke: anEvent
anEvent wasHandled: true.
self inform: anEvent  asString  .
while this reacts eg on tab or shift-up, it does not react on shift-tab,
somehow strange. and it shoudnt be the OS, since Pharo 1.2 gets the
shift-tab.
werner



Werner Kassens Werner Kassens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: focus setting

i noticed that although i dont get a keystroke event for shift-tab, i do
get keyUp and keyDown events. obviously they all come from the vm and
the new vm in Pharo 1.3 probably cant keep up with my very old linux
version. otoh i cant open the 1.3 image with the vm from Pharo 1.2 (This
interpreter (vers. 6502) cannot read image file (vers. 6505) ). i guess,
one day or another i have to update to a newer linux version. for the
moment i just changed the shift-tab keyDown event to a keystroke event,
since i need the keystroke event but not the keyDown one. or is there an
older vm more similar to the one in Pharo 1.2, that can open the 1.3 image?
werner

Loading...