Controlling Lists with the keyboard

Martin Pammer mpammer at vrz.net
Mon Feb 2 15:22:39 UTC 1998


Dear Squeakers

I thought that controlling the lists in the Browser with the keyboard would
be fine.

So I have come up with the following code

'From Squeak 1.3 of Jan 16, 1998 on 25 January 1998 at 4:01:20 pm'!
!ListController methodsFor: 'menu messages' stamp: 'pm 1/24/98 22:20'!
processKeyboard
     | keyEvent oldSelection nextSelection max min howMany |
     keyEvent := self sensor keyboard asciiValue.
     oldSelection := view selection.
     nextSelection := oldSelection.
     max := view maximumSelection.
     min := view minimumSelection.
     howMany := view clippingBox height // view list lineGrid.
     keyEvent == 31 ifTrue: [nextSelection := (oldSelection + 1) min: max].
     keyEvent == 30      ifTrue: [nextSelection := (oldSelection - 1) max:
min].
     keyEvent == 1  ifTrue: [nextSelection := 1].
     keyEvent == 4  ifTrue: [nextSelection := max].
     keyEvent == 11 ifTrue: [nextSelection := min max: (oldSelection -
howMany)].
     keyEvent == 12  ifTrue: [nextSelection := (oldSelection + howMany)
min: max].
     nextSelection = oldSelection  ifFalse: [self changeModelSelection:
nextSelection]. ! !

Now I have the following question:

How can I manage to jump from one list control to the other (e.g. with the
"tab" key) ?
     keyEvent == 9  ifTrue: [ ??? What to do here ??? ]

BTW How can I cycle through the top windows with keys ?

Best regards

Martin Pammer
(VRZ Informatik
Dornbirn, Austria)





More information about the Squeak-dev mailing list