Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 562525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:33:50+00:00 2026-05-13T12:33:50+00:00

I am implementing a graphical user interface with Morphic / Squeak. Some of the

  • 0

I am implementing a graphical user interface with Morphic / Squeak. Some of the items have drag & drop functionality. While dragging, I want to be able to rotate these items with the mousewheel.

The first problem is that using the mousewheel ends the drag-action and leads to a drop (attempt). How can I suppress that – and fire the mouseWheelEvent at the same time?

The second problem: How can I assign a mousewheel-event to my Morph? As mentioned above, this event only is relevant while dragging this Morph. (solved)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:33:50+00:00Added an answer on May 13, 2026 at 12:33 pm

    Appears that on VM implementations that have chosen to support it, Squeak maps the mouse wheel to Ctrl Up-Arrow and Ctrl-Down-Arrow key events. For instance, on Win32 in sqWin32Window.c:

    if( WM_MOUSEWHEEL == message || g_WM_MOUSEWHEEL == message ) {
        /* Record mouse wheel msgs as CTRL-Up/Down */
        short zDelta = (short) HIWORD(wParam);
        if(inputSemaphoreIndex) {
            sqKeyboardEvent *evt = (sqKeyboardEvent*) sqNextEventPut();
            evt->type = EventTypeKeyboard;
            evt->timeStamp = lastMessage->time;
            evt->charCode = (zDelta > 0) ? 30 : 31;
            evt->pressCode = EventKeyChar;
            evt->modifiers = CtrlKeyBit;
            evt->utf32Code = 0;
            evt->reserved1 = 0;
        } else {
            buttonState = 64;
            if (zDelta < 0) {
                recordVirtualKey(message,VK_DOWN,lParam);
            } else {
                recordVirtualKey(message,VK_UP,lParam);
            }
        }
        return 1;
    }
    

    So that’s pretty much what you’ve got to work with inside Squeak. (If you’re using the Polymorph extensions, there is a special mouseWheel event, but all they’re doing is filtering Ctrl-Up and Ctrl-Down and generating a “fake” MouseWheelEvent message.)

    Looking at a bit of code for handleEvent in HandMorph:

    evt isMouse ifTrue:[
        self sendListenEvent: evt to: self mouseListeners.
        lastMouseEvent _ evt].
    
        "Check for pending drag or double click operations."
        mouseClickState ifNotNil:[
            (mouseClickState handleEvent: evt from: self) ifFalse:[
            "Possibly dispatched #click: or something and will not re-establish otherwise"
            ^self mouseOverHandler processMouseOver: lastMouseEvent]].
    
            evt isMove ifTrue:[
                self position: evt position.
                self sendMouseEvent: evt.
            ] ifFalse:[
                "Issue a synthetic move event if we're not at the position of the event"
                (evt position = self position) ifFalse:[self moveToEvent: evt].
                "Drop submorphs on button events"
                (self hasSubmorphs) 
                    ifTrue:[self dropMorphs: evt]
                    ifFalse:[self sendMouseEvent: evt].
            ].
    

    The Polymorph MouseWheelEvent is a subclass of MouseEvent that doesn’t return true to isMove, hence you get a drop. You’ll have to change something here if you want this to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm designing GUI (graphical user interface) system for a game engine (C++). Idea is
In my app, there are some shapes that the user can drag around the
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
When implementing Serializable interface, in Java, we need to set it's serialVersionUID long. Is
I'm having some trouble implementing DoubleBuffer into my program. Before you faint from the
I'm working on implementing deferred shading to my game. I have rendered the diffuse
I am interested in implementing some particle techniques for fluid simulation on GPU's using
I have this task of designing a new interface for a distributed application (multiple
We are implementing Git at our company and coming from SVN, I have a
Implementing a custom Dependency Property on a Framework Element object causes my Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.