a fuller, firmer keyboard for Zaurus 5x00 (and dynapad 0.1)
Brian Keefer
mgomes21 at cox.net
Fri Aug 29 12:33:33 UTC 2003
This is a small hack to turn *(star, Fn-k) into a shift key to type in the
missing keys that are so important to smalltalk, []^|. When you press
Fn-k, the 5 keys i,j,k,l,m form a little "crosspad" of alternatives for
the next keypress.
i
j k l
m
turns into..
^
[ * ]
|
-------------- next part --------------
'From Squeak2.8 of 13 June 2000 [latest update: #2359] on 29 August 2003 at 12:22:51 am'!
InputSensor subclass: #Zaurus5x00InputSensor
instanceVariableNames: 'shiftMode '
classVariableNames: 'ShiftMap '
poolDictionaries: ''
category: 'Kernel-Processes'!
!Zaurus5x00InputSensor methodsFor: 'as yet unclassified' stamp: 'bmk 8/28/2003 23:13'!
keyboard
^ self shiftOrPassKeycode: self primKbdNext peeking:false! !
!Zaurus5x00InputSensor methodsFor: 'as yet unclassified' stamp: 'bmk 8/28/2003 23:14'!
keyboardPeek
^ self shiftOrPassKeycode: self primKbdPeek peeking:true! !
!Zaurus5x00InputSensor methodsFor: 'as yet unclassified' stamp: 'bmk 8/28/2003 22:30'!
keyboardPressed
^ self keyboardPeek notNil! !
!Zaurus5x00InputSensor methodsFor: 'as yet unclassified' stamp: 'bmk 8/28/2003 22:47'!
shiftMode
shiftMode ifNil:[shiftMode:=false].
^shiftMode! !
!Zaurus5x00InputSensor methodsFor: 'as yet unclassified' stamp: 'bmk 8/29/2003 00:20'!
shiftOrPassKeycode: keycode peeking: isPeeking
|cookedKey|
cookedKey:=self characterForKeycode:keycode.
self shiftMode ifTrue:[
isPeeking ifFalse:[shiftMode:=false]. "don't clear the shiftmode if it's just a peek, next peek will repeat same shift lookup"
^self class shiftMap at:cookedKey ifAbsent:[cookedKey]
] ifFalse:[ "not in shiftmode"
cookedKey=$* ifTrue:[
shiftMode:=true.
self primKbdNext. "absorb the shift key"
^nil.
] ifFalse:[^cookedKey]
] ! !
!Zaurus5x00InputSensor class methodsFor: 'as yet unclassified' stamp: 'bmk 8/29/2003 00:22'!
default
^Sensor! !
!Zaurus5x00InputSensor class methodsFor: 'as yet unclassified' stamp: 'bmk 8/29/2003 00:22'!
install
Smalltalk at:#Sensor put:self new! !
!Zaurus5x00InputSensor class methodsFor: 'as yet unclassified' stamp: 'bmk 8/28/2003 23:05'!
shiftMap
ShiftMap ifNil:[
ShiftMap:=Dictionary new.
ShiftMap at:$k put:$*.
ShiftMap at:$K put:$*.
ShiftMap at:$* put:$*.
ShiftMap at:$j put:$[.
ShiftMap at:$J put:$[.
ShiftMap at:$& put:$[.
ShiftMap at:$l put:$].
ShiftMap at:$L put:$].
ShiftMap at:$( put:$].
ShiftMap at:$i put:$^.
ShiftMap at:$I put:$^.
ShiftMap at:$8 put:$^.
ShiftMap at:$m put:$|.
ShiftMap at:$M put:$|.
ShiftMap at:$= put:$|.
].
^ShiftMap
! !
Zaurus5x00InputSensor removeSelector: #characterForKeycode:!
Zaurus5x00InputSensor removeSelector: #cookedCharacterForKeycode:!
Zaurus5x00InputSensor removeSelector: #shiftCharacter:!
Zaurus5x00InputSensor removeSelector: #shiftOrPassCharacter:!
Zaurus5x00InputSensor removeSelector: #shiftOrPassKeycode:!
Zaurus5x00InputSensor removeSelector: #starMode!
"Postscript:
Leave the line above, and replace the rest of this comment by a useful one.
Executable statements should follow this comment, and should
be separated by periods, with no exclamation points (!!).
Be sure to put any further comments in double-quotes, like this one."
Zaurus5x00InputSensor install!
More information about the Squeak-dev
mailing list
|