A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ael.643.mcz ==================== Summary ==================== Name: Kernel-ael.643 Author: ael Time: 19 October 2011, 4:09:37.67 pm UUID: 1fb9163b-7fc4-7946-a812-27626936cc50 Ancestors: Kernel-nice.642 Proposed change for enabling both Yellow and Blue buttons from a two-button mouse in Cog VM =============== Diff against Kernel-nice.642 =============== Item was changed: ----- Method: EventSensor>>processEvent: (in category 'private-I/O') ----- processEvent: evt "Process a single event. This method is run at high priority." + | type buttons | - | type | type := evt at: 1. "Tackle mouse events first" type = EventTypeMouse + ifTrue: [buttons := (ButtonDecodeTable at: (evt at: 5) + 1). + evt at: 5 put: (Smalltalk platformName = 'Mac OS' + ifTrue: [ buttons ] + ifFalse: [ self mapButtons: buttons modifiers: (evt at: 6) ]). - ifTrue: [evt - at: 5 - put: (ButtonDecodeTable at: (evt at: 5) - + 1). self queueEvent: evt. self processMouseEvent: evt . ^self]. "Store the event in the queue if there's any" type = EventTypeKeyboard ifTrue: [ "Check if the event is a user interrupt" ((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]. "Else swap ctrl/alt keys if neeeded. Look at the Unicode char first, then ascii." KeyDecodeTable at: {evt at: 6. evt at: 5} ifPresent: [:a | evt at: 6 put: a first; at: 5 put: a second]. KeyDecodeTable at: {evt at: 3. evt at: 5} ifPresent: [:a | evt at: 3 put: a first; at: 5 put: a second]. self queueEvent: evt. self processKeyboardEvent: evt . ^self ]. "Handle all events other than Keyborad or Mouse." self queueEvent: evt. ! |
Hi
I just posted a one-method proposed change to EventSensor, as a way to enable use of both yellow- and blue-button clicks in a Cog VM running on Windows. Background: Running a Squeak image with Cog on Windows (for example, the 4.3alpha image on Cog 4.0.0 of Oct 9, 2011) it seems there is no way to have both yellow-click (e.g., context menu) and blue-click (e.g., halo) available at the same time. Without enabling either of the VM (F2) 1-button or 3-button mouse settings, the behaviour of the right button of a 2-button mouse is determined by the swapMouseButtons preference. With swapMouseButtons enabled, the available clicks are Left: red Ctrl-left: [morphic menu] Alt-left: red Right: blue With swapMouseButtons disabled, the only change is Right: yellow On MacOS there is additional scope for configuration, through info.plist. But not on Windows. Proposed fix: It seems that what's needed is a call of mapButtons:modifiers: from EventSensor>>processEvent: With this step included (for non-MacOS platforms only), we can obtain the following mapping: [swapMouseButtons disabled] Left: red Ctrl-left: [morphic menu] Alt-left: blue Right: yellow ...so finally we have a way to get blue *and* a way to get yellow (with thanks to Bert Freudenberg for helping track down where the mapping should be done). What I don't understand is how other people have been doing this up to now. Surely there are some Windows users of Cog?? Aran -- Aran Lunzer Viewpoints Research |
Well, I've personally just been frustrated by it (as a Windows Cog
user). But, I haven't been using it regularly enough to try and track anything down. -Chris On Wed, Oct 19, 2011 at 4:30 PM, Aran Lunzer <[hidden email]> wrote: > Hi > > I just posted a one-method proposed change to EventSensor, as a way to > enable use of both yellow- and blue-button clicks in a Cog VM running > on Windows. > > Background: > > Running a Squeak image with Cog on Windows (for example, the 4.3alpha > image on Cog 4.0.0 of Oct 9, 2011) it seems there is no way to have > both yellow-click (e.g., context menu) and blue-click (e.g., halo) > available at the same time. > > Without enabling either of the VM (F2) 1-button or 3-button mouse > settings, the behaviour of the right button of a 2-button mouse is > determined by the swapMouseButtons preference. > > With swapMouseButtons enabled, the available clicks are > > Left: red > Ctrl-left: [morphic menu] > Alt-left: red > Right: blue > > With swapMouseButtons disabled, the only change is > > Right: yellow > > On MacOS there is additional scope for configuration, through > info.plist. But not on Windows. > > > Proposed fix: > > It seems that what's needed is a call of mapButtons:modifiers: from > EventSensor>>processEvent: > With this step included (for non-MacOS platforms only), we can obtain > the following mapping: > > [swapMouseButtons disabled] > > Left: red > Ctrl-left: [morphic menu] > Alt-left: blue > Right: yellow > > > ...so finally we have a way to get blue *and* a way to get yellow > (with thanks to Bert Freudenberg for helping track down where the > mapping should be done). > > What I don't understand is how other people have been doing this up to > now. Surely there are some Windows users of Cog?? > > > Aran > -- > Aran Lunzer > Viewpoints Research > > |
It seems like a VM bug though. The VM is supposed to do the mapping, and the VM options are there to configure that.
IIUC the interpreter VM on Windows gets it right, yes? - Bert - On 20.10.2011, at 17:21, Chris Cunningham wrote: > Well, I've personally just been frustrated by it (as a Windows Cog > user). But, I haven't been using it regularly enough to try and track > anything down. > > -Chris > On Wed, Oct 19, 2011 at 4:30 PM, Aran Lunzer <[hidden email]> wrote: >> Hi >> >> I just posted a one-method proposed change to EventSensor, as a way to >> enable use of both yellow- and blue-button clicks in a Cog VM running >> on Windows. >> >> Background: >> >> Running a Squeak image with Cog on Windows (for example, the 4.3alpha >> image on Cog 4.0.0 of Oct 9, 2011) it seems there is no way to have >> both yellow-click (e.g., context menu) and blue-click (e.g., halo) >> available at the same time. >> >> Without enabling either of the VM (F2) 1-button or 3-button mouse >> settings, the behaviour of the right button of a 2-button mouse is >> determined by the swapMouseButtons preference. >> >> With swapMouseButtons enabled, the available clicks are >> >> Left: red >> Ctrl-left: [morphic menu] >> Alt-left: red >> Right: blue >> >> With swapMouseButtons disabled, the only change is >> >> Right: yellow >> >> On MacOS there is additional scope for configuration, through >> info.plist. But not on Windows. >> >> >> Proposed fix: >> >> It seems that what's needed is a call of mapButtons:modifiers: from >> EventSensor>>processEvent: >> With this step included (for non-MacOS platforms only), we can obtain >> the following mapping: >> >> [swapMouseButtons disabled] >> >> Left: red >> Ctrl-left: [morphic menu] >> Alt-left: blue >> Right: yellow >> >> >> ...so finally we have a way to get blue *and* a way to get yellow >> (with thanks to Bert Freudenberg for helping track down where the >> mapping should be done). >> >> What I don't understand is how other people have been doing this up to >> now. Surely there are some Windows users of Cog?? >> >> >> Aran >> -- >> Aran Lunzer >> Viewpoints Research >> >> > |
On Thu, Oct 20, 2011 at 9:29 AM, Bert Freudenberg <[hidden email]> wrote: It seems like a VM bug though. The VM is supposed to do the mapping, and the VM options are there to configure that. Cog's platform tree is a fork from (I think) Squeak 3.8 and was modified at Qwaq/Teleplace over quite a few years. I think the right approach is to merge in the standard platform hierarchy so that the Cog VM's behaviour agrees with the standard VM. But that's work :(
IIUC the interpreter VM on Windows gets it right, yes? best, Eliot |
Free forum by Nabble | Edit this page |