pending mac vm 3.8.9b5
Serge Stinckwich
Serge.Stinckwich at info.unicaen.fr
Mon Oct 24 16:49:40 UTC 2005
John M McIntosh a écrit :
> Ok, well you know you can set the interrupt key to something else.
>
> In EventSensor >> process event you have
> "Check if the event is a user interrupt"
> (type = EventTypeKeyboard and:[(evt at: 4) = 0 and:[
> ((evt at: 3) bitOr: ((evt at: 5) bitShift: 8)) = interruptKey]])
> ifTrue:["interrupt key is meta - not reported as event"
> ^interruptSemaphore signal].
>
> Keyboard events
> ====================
> Keyboard events are generated when keyboard input is detected.
> [1] - event type 2
> [2] - time stamp
> [3] - character code
> [4] - press state; integer with the following meaning
> 0 - character
> 1 - key press (down)
> 2 - key release (up)
> [5] - modifier keys; bitfield with the following entries:
> 1 - shift key
> 2 - ctrl key
> 4 - (Mac specific) option key
> 8 - Cmd/Alt key
>
>
>
> which means if you fiddle with the interruptKey value you can set it to
> something else.
>
>
> Sensor setInterruptKey: ($. asciiValue bitOr: 16r0800)
>
> that sets it to cmd '.' on english keyboard, but I wonder if the code
> is really ($. asciiValue bitOr: 16r0900) because you are hitting shift
> cmd '.'
>
Ok, it works !
> Seems to me this should a preference in the image that one can override.
Why a preference ?
Here is a changeset to allow to use the shift key for the Cmd-.
I test it with the french and american keyboard.
Could people with different keyboard layout (belgian, spanish, ...)
could also test this changeset ?
Thanks you,
-- oooo
Dr. Serge Stinckwich OOOOOOOO
Université de Caen>CNRS UMR 6072>GREYC>MAD OOESUGOO
http://purl.org/net/SergeStinckwich oooooo
Smalltalkers do: [:it | All with: Class, (And love: it)] \ /
##
-------------- next part --------------
'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 24 October 2005 at 6:42:13 pm'!
!EventSensor methodsFor: 'private-I/O' stamp: 'zz 10/24/2005 18:41'!
processEvent: evt
"Process a single event. This method is run at high priority."
| type |
type := evt at: 1.
"Check if the event is a user interrupt"
(type = EventTypeKeyboard and:[(evt at: 4) = 0 and:[
((evt at: 3) bitOr: (((evt at: 5) bitAnd:8) bitShift: 8)) = interruptKey]])
ifTrue:["interrupt key is meta - not reported as event"
^interruptSemaphore signal].
"Store the event in the queue if there's any"
type = EventTypeMouse ifTrue:
[evt at: 5 put: (ButtonDecodeTable at: (evt at: 5) + 1)].
type = EventTypeKeyboard ifTrue:
["swap ctrl/alt keys"
KeyDecodeTable at: { evt at: 3 . evt at: 5 } ifPresent: [:a |
evt at: 3 put: a first;
at: 5 put: a second]].
self queueEvent: evt.
"Update state for InputSensor."
EventTypeMouse = type ifTrue:[self processMouseEvent: evt].
EventTypeKeyboard = type ifTrue:[self processKeyboardEvent: evt]! !
More information about the Squeak-dev
mailing list
|