The Inbox: Morphic-mva.1465.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-mva.1465.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-mva.1465.mcz

==================== Summary ====================

Name: Morphic-mva.1465
Author: mva
Time: 7 November 2018, 9:30:51.376226 pm
UUID: 8ece769f-8df7-436c-8d42-37f798a6849a
Ancestors: Morphic-eem.1464

Convert Ctrl-left/right to mouse wheel events to fix
"VM sending keystrokes on mouse-wheel?"
http://forum.world.st/VM-sending-keystrokes-on-mouse-wheel-td5088162.html
using Tom Beckmann's idea.

Use the generated wheeelLeft and wheelRight
events in ScrollPane to scroll sideways if horizontal
scrollbars are not suppressed by
alwaysHideHScrollbar preference.

=============== Diff against Morphic-eem.1464 ===============

Item was changed:
  ----- Method: HandMorph>>filterEvent:for: (in category 'events-filtering') -----
  filterEvent: aKeyboardEvent for: aMorphOrNil
  "Fixes VM behavior. Usually, there are no mouse wheel events generated by the VM but CTRL+UP/DOWN. Convert these into mouse wheel events.
 
  We installed ourself as keyboard filter only!! No need to check whether this is a keyboard event or not!! See HandMorph >> #initForEvents.
 
  Might be removed in the future if this mapping gets obsolete."
 
  HandMorph synthesizeMouseWheelEvents ifFalse: [^ aKeyboardEvent].
 
  (aKeyboardEvent isKeystroke and: [aKeyboardEvent controlKeyPressed]) ifTrue: [
  aKeyboardEvent keyCharacter caseOf: {
  [Character arrowUp] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r1000].
  [Character arrowDown] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0100].
+ [Character arrowLeft] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0010].
+ [Character arrowRight] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0001].
  } otherwise: [^ aKeyboardEvent]].
 
  ^ aKeyboardEvent!

Item was changed:
  ----- Method: ScrollPane>>mouseWheel: (in category 'event handling') -----
  mouseWheel: evt
 
  evt isWheelUp ifTrue: [scrollBar scrollUp: 3].
+ evt isWheelDown ifTrue: [scrollBar scrollDown: 3].
+ evt isWheelLeft ifTrue: [hScrollBar scrollUp: 3].
+ evt isWheelRight ifTrue: [hScrollBar scrollDown: 3].
+ !
- evt isWheelDown ifTrue: [scrollBar scrollDown: 3].!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Tobias Pape
Hi

> On 07.11.2018, at 21:34, [hidden email] wrote:
>
> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-mva.1465.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mva.1465
> Author: mva
> Time: 7 November 2018, 9:30:51.376226 pm
> UUID: 8ece769f-8df7-436c-8d42-37f798a6849a
> Ancestors: Morphic-eem.1464
>
> Convert Ctrl-left/right to mouse wheel events to fix
> "VM sending keystrokes on mouse-wheel?"
> http://forum.world.st/VM-sending-keystrokes-on-mouse-wheel-td5088162.html
> using Tom Beckmann's idea.
>
> Use the generated wheeelLeft and wheelRight
> events in ScrollPane to scroll sideways if horizontal
> scrollbars are not suppressed by
> alwaysHideHScrollbar preference.

Does that mean that ctrl-left/right can no longer be used to move word-wise?
Just askin.

Best regards
        -Tobias

>
> =============== Diff against Morphic-eem.1464 ===============
>
> Item was changed:
>  ----- Method: HandMorph>>filterEvent:for: (in category 'events-filtering') -----
>  filterEvent: aKeyboardEvent for: aMorphOrNil
>   "Fixes VM behavior. Usually, there are no mouse wheel events generated by the VM but CTRL+UP/DOWN. Convert these into mouse wheel events.
>  
>   We installed ourself as keyboard filter only!! No need to check whether this is a keyboard event or not!! See HandMorph >> #initForEvents.
>  
>   Might be removed in the future if this mapping gets obsolete."
>  
>   HandMorph synthesizeMouseWheelEvents ifFalse: [^ aKeyboardEvent].
>  
>   (aKeyboardEvent isKeystroke and: [aKeyboardEvent controlKeyPressed]) ifTrue: [
>   aKeyboardEvent keyCharacter caseOf: {
>   [Character arrowUp] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r1000].
>   [Character arrowDown] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0100].
> + [Character arrowLeft] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0010].
> + [Character arrowRight] -> [^ self generateMouseWheelEvent: aKeyboardEvent direction: 2r0001].
>   } otherwise: [^ aKeyboardEvent]].
>  
>   ^ aKeyboardEvent!
>
> Item was changed:
>  ----- Method: ScrollPane>>mouseWheel: (in category 'event handling') -----
>  mouseWheel: evt
>
>   evt isWheelUp ifTrue: [scrollBar scrollUp: 3].
> + evt isWheelDown ifTrue: [scrollBar scrollDown: 3].
> + evt isWheelLeft ifTrue: [hScrollBar scrollUp: 3].
> + evt isWheelRight ifTrue: [hScrollBar scrollDown: 3].
> + !
> - evt isWheelDown ifTrue: [scrollBar scrollDown: 3].!
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Squeak - Dev mailing list
> Does that mean that ctrl-left/right can no longer be used to move
word-wise?
> Just askin.
>
> Best regards
> -Tobias

Hmm. Sorry. That's what it means, unfortunately.
I did not notice because I don't really use Ctrl-left/right to move word
wise myself.
Bummer.

The part of
ScrollPane>>mouseWheel:
that adds support for left/right scrolling should probably be somewhere
else, perhaps
in PluggableListMorph, I'm not sure right now.
Bad idea to bundle it with the other thing.

Anyway, if you merge the
HandMorph>>#filterEvent:for:
then the original problem goes away.

-- Milan




--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Squeak - Dev mailing list
Sorry, please disregard the "Inbox: Morphic-mva.1465.mcz"
-- Milan



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Sean P. DeNigris
Administrator
In reply to this post by Tobias Pape
Tobias Pape wrote
> Does that mean that ctrl-left/right can no longer be used to move
> word-wise?
> Just askin.

I only skimmed but it looks like the original solution in Pharo before we
abandoned it for the above reason. The workaround was to send a keystroke
with all modifiers pressed to make conflicts less likely. Elliot just asked
about the VM-side of this on the VM list [1]. Coincidence?

1.
http://forum.world.st/On-community-development-of-the-VM-s-platform-code-tp5088397.html



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Bert Freudenberg
On Wed, Nov 7, 2018 at 2:19 PM Sean P. DeNigris <[hidden email]> wrote:
Tobias Pape wrote
> Does that mean that ctrl-left/right can no longer be used to move
> word-wise?
> Just askin.

I only skimmed but it looks like the original solution in Pharo before we
abandoned it for the above reason. The workaround was to send a keystroke
with all modifiers pressed to make conflicts less likely. Elliot just asked
about the VM-side of this on the VM list [1]. Coincidence?

1.
http://forum.world.st/On-community-development-of-the-VM-s-platform-code-tp5088397.html


Setting all modifier bits to indicate the fake wheel event seems like a good short-term solution (*). Just need to have all VMs do this.

(*) the actual solution being to add a new event type to all VMs.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-mva.1465.mcz

Beckmann, Tom

I tried my luck on the actual solution: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/303


As written on the PR, all seems to work fine without needing to change anything in the image, but more testing should be done.



From: Squeak-dev <[hidden email]> on behalf of Bert Freudenberg <[hidden email]>
Sent: Wednesday, November 7, 2018 11:43 PM
To: The general-purpose Squeak developers list
Subject: Re: [squeak-dev] The Inbox: Morphic-mva.1465.mcz
 
On Wed, Nov 7, 2018 at 2:19 PM Sean P. DeNigris <[hidden email]> wrote:
Tobias Pape wrote
> Does that mean that ctrl-left/right can no longer be used to move
> word-wise?
> Just askin.

I only skimmed but it looks like the original solution in Pharo before we
abandoned it for the above reason. The workaround was to send a keystroke
with all modifiers pressed to make conflicts less likely. Elliot just asked
about the VM-side of this on the VM list [1]. Coincidence?

1.
http://forum.world.st/On-community-development-of-the-VM-s-platform-code-tp5088397.html


Setting all modifier bits to indicate the fake wheel event seems like a good short-term solution (*). Just need to have all VMs do this.

(*) the actual solution being to add a new event type to all VMs.

- Bert -