Login  Register

Re: Alt-tab between windows

Posted by carlo.t on May 16, 2015; 6:06am
URL: https://forum.world.st/Alt-tab-between-windows-tp4826593p4826703.html

Hi

I see my earlier email was bounced.
...

Ok, hacked and debugged my pharo 4 image and I've got ctrl- left or right working on my mac.

Two changes needed

TaskListMorph>>keyStroke: event  needs to change as per below to add the ctrl left or right.

TaskListMorph>>keyStroke: event
        "Process keys to switch task."
        event keyCharacter = Character escape ifTrue: [^self delete].
        event anyModifierKeyPressed ifFalse: [^self done].

        event keyString =  '<Ctrl-left>' ifTrue: [^self selectPreviousTask].
        event keyString =  '<Ctrl-right>' ifTrue: [^self selectNextTask].
               
        event keyString =  '<Opt-Shift-tab>' ifTrue: [^self selectPreviousTask].
        event keyString =  '<Opt-tab>' ifTrue: [^self selectNextTask]

Then TaskListMorph>>isNavigationEvent: aKeyboardEvent needs to change as per below:

isNavigationEvent: aKeyboardEvent
        | validCombos |
        validCombos := Array with: Character tab alt with: Character tab alt shift with: Character arrowLeft ctrl with: Character arrowRight ctrl .
        ^ validCombos contains: [:each | each = aKeyboardEvent asKeyCombination].

Ctrl-left or Ctrl-right works, and again you need to press any key to select the window on preview.

Cheers
Carlo