Mouse Wheel Rotation not reported in WinXP

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

Mouse Wheel Rotation not reported in WinXP

Rufus V. Smith
This is very frustrating for me.  I wrote a "wave viewer" program using
wxPython, and my first iteration was on a Macbook pro, and everything worked
great.    But when I ran the same code on a WinXP laptop, I no longer
received the mouse wheel events (and actually, it's the exact same mouse,
because I have the Logitech and I move the USB receiver from Macbook to
laptop).  The wx version is 2.8.12.1 (msw-ansi)  There are some other field
difference (like lower case x for mouse position).
However, all mouse changes are reported as zero.




--
Sent from: http://wxpython-users.1045709.n5.nabble.com/

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

GadgetSteve


On 29/10/2017 08:12, Rufus V. Smith wrote:

> This is very frustrating for me.  I wrote a "wave viewer" program using
> wxPython, and my first iteration was on a Macbook pro, and everything worked
> great.    But when I ran the same code on a WinXP laptop, I no longer
> received the mouse wheel events (and actually, it's the exact same mouse,
> because I have the Logitech and I move the USB receiver from Macbook to
> laptop).  The wx version is 2.8.12.1 (msw-ansi)  There are some other field
> difference (like lower case x for mouse position).
> However, all mouse changes are reported as zero.
>
>
>
>
> --
> Sent from: https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwxpython-users.1045709.n5.nabble.com%2F&data=02%7C01%7Cgadgetsteve%40live.co.uk%7Cefbf5d79669045bcabb808d51ea4d017%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636448615559293971&sdata=59x3cLBWF7ZWSoWQk3wqHZYfTl%2FpTJfT9VZTvE5gV8U%3D&reserved=0
>

Please note that the current version of wxPython is 4.0 and the current
versions of Python are 3.6 & 2.7 - if you are running on XP (no longer
supported by Microsoft since 8 April 2014) you must be running python <=
2.5.4 expecting modern mouse wheel actions on such an old system is
optimistic.

Can I suggest bringing things a little more up to date.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
http://www.avg.com

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

Rufus V. Smith
Thanks Steve.  While I understand bringing things up to current levels is
typically the best policy, I am designing this to run on some legacy machine
control packages, which cannot be upgraded past the "if it ain't broke,
don't fix it" Windows XP stage.  I am developing the XP version on a Dell
Latitude D630 laptop, Windows XP professional 5.1.2600,  Python version
2.7.3 and wxPython 2.8.12.1.  

I did a simple test with a multiline text control, and its scrollbar does
get the wheel events, so they are available somewhere, I would think.
(Though I just did a test with my own program and noticed there
were no wx.MouseEvents for only scroll wheel movement without mouse
movement, so it may be impossible through current wx - or maybe it needs to
be enabled somehow).

If XP and wx.TextCtrl can get the wheel movement, there must be some way to
capture them, even if it means getting it outside of the wx framework and
making direct Windows calls.

Rufus




--
Sent from: http://wxpython-users.1045709.n5.nabble.com/

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

Bob Klahn-2
Rufus, I'm using Python 2.7.13 with wxPython version "3.0.2.0 msw (classic)" on a Windows 7 machine with an XP virtual machine, and before this I was running on Windows XP itself.  Wheel rotation has always worked perfectly here in my long-term wx.grid application.  The few lines below are all the wheel-specific code I need:

    self.Bind(wx.EVT_MOUSEWHEEL, self.OnWheel)

    def OnWheel(self, evt):
        delta = evt.GetWheelDelta()
        rot   = evt.GetWheelRotation()
        vsx, vsy = grid.GetViewStart()
        grid.Scroll(0, max(0,vsy - 2*rot/delta))

Bob

On 10/29/2017 2:14 PM, Rufus V. Smith wrote:
Thanks Steve.  While I understand bringing things up to current levels is
typically the best policy, I am designing this to run on some legacy machine
control packages, which cannot be upgraded past the "if it ain't broke,
don't fix it" Windows XP stage.  I am developing the XP version on a Dell
Latitude D630 laptop, Windows XP professional 5.1.2600,  Python version
2.7.3 and wxPython 2.8.12.1.   

I did a simple test with a multiline text control, and its scrollbar does
get the wheel events, so they are available somewhere, I would think. 
(Though I just did a test with my own program and noticed there
were no wx.MouseEvents for only scroll wheel movement without mouse
movement, so it may be impossible through current wx - or maybe it needs to
be enabled somehow).

If XP and wx.TextCtrl can get the wheel movement, there must be some way to
capture them, even if it means getting it outside of the wx framework and
making direct Windows calls.

Rufus

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

Rufus V. Smith
Thanks Bob, that is basically the same code I use on the MacBook. (Python 2.710, and wx 3.0.3.0.b20160914 osx-cocoa (classic))
Though the mouse panel events are bound with:

        self.panel.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouse)

and in self.OnMouse, i use:

        wheel_delta = event.GetWheelRotation()

Which works fine on the Mac.  I just get 0 on the laptop, but as I said, it is being called by another event (drag/button), rather
than the mouse wheel movement.

I'll upgrade the Python and wxPython on the laptop and see if that suffices.

Rufus


On Oct 29, 2017, at 5:21 PM, Bob Klahn <[hidden email]> wrote:

Rufus, I'm using Python 2.7.13 with wxPython version "3.0.2.0 msw (classic)" on a Windows 7 machine with an XP virtual machine, and before this I was running on Windows XP itself.  Wheel rotation has always worked perfectly here in my long-term wx.grid application.  The few lines below are all the wheel-specific code I need:

    self.Bind(wx.EVT_MOUSEWHEEL, self.OnWheel)

    def OnWheel(self, evt):
        delta = evt.GetWheelDelta()
        rot   = evt.GetWheelRotation()
        vsx, vsy = grid.GetViewStart()
        grid.Scroll(0, max(0,vsy - 2*rot/delta))

Bob


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

Robin Dunn
In reply to this post by Rufus V. Smith
On Windows prior to version 10 the system only recognizes wheel events when the cursor is over the widget that has the focus. So if the widget you want to scroll does not have the keyboard focus it simply will not work. The user will have to click on the widget first and then scroll. If the widget does not normally accept the focus (like a panel with children that do accept the focus) then you'll need to change it so it does or provide some other way. It's a PITA, but it's Microsoft so pain is to be expected.


Robin

On Sunday, October 29, 2017 at 1:12:34 AM UTC-7, Rufus wrote:
This is very frustrating for me.  I wrote a "wave viewer" program using
wxPython, and my first iteration was on a Macbook pro, and everything worked
great.    But when I ran the same code on a WinXP laptop, I no longer
received the mouse wheel events (and actually, it's the exact same mouse,
because I have the Logitech and I move the USB receiver from Macbook to
laptop).  The wx version is 2.8.12.1 (msw-ansi)  There are some other field
difference (like lower case x for mouse position).
However, all mouse changes are reported as zero.




--
Sent from: <a href="http://wxpython-users.1045709.n5.nabble.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwxpython-users.1045709.n5.nabble.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGwU_VyCKXCOe_gRYAG28IMARnUFA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwxpython-users.1045709.n5.nabble.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGwU_VyCKXCOe_gRYAG28IMARnUFA&#39;;return true;">http://wxpython-users.1045709.n5.nabble.com/

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Rotation not reported in WinXP

Rufus V. Smith
Thanks Robin, that provides some good clues.   I had interesting progress in the interim:

After reading Bob Klahn's response I did upgrade my python to version  2.7.14, and my 
wxPython to version 3.0.2.0 msg (classic).  It helped, some.

When I first start up the program, the panel did (and does) in fact get wheel movement.  Initially.
So the version may have been a factor.  But then they stopped coming in during running:

I added some additional buttons off the panel that I was drawing on.  When I clicked any of the
buttons, the wheel events stopped, even after clicking back on the panel.  The other mouse events
still came in via the panel binding.

So I thought, "What's the deal with the wheel events?  They have to be going somewhere!"  So I
bound handlers to the Frame as well, and sure enough, there they were.  So ror now, I can work 
with that, but it's interesting that the panel seems to have focus for the wheel events at the beginning,
but does not regain them, even when clicking back on the panel.

Then I saw Robin's message, which corroborated my observations.  I have yet to find out if this
development is going to be a problem.   (I suppose if I have multiple graph panels, and go back and
forth between them, I may have to keep track of the focused panel myself for the wheel events.)

Now I'm off to see if explicitly setting panel focus will move the wheel event....












On Oct 30, 2017, at 12:32 PM, Robin Dunn <[hidden email]> wrote:

On Windows prior to version 10 the system only recognizes wheel events when the cursor is over the widget that has the focus. So if the widget you want to scroll does not have the keyboard focus it simply will not work. The user will have to click on the widget first and then scroll. If the widget does not normally accept the focus (like a panel with children that do accept the focus) then you'll need to change it so it does or provide some other way. It's a PITA, but it's Microsoft so pain is to be expected.


Robin

On Sunday, October 29, 2017 at 1:12:34 AM UTC-7, Rufus wrote:
This is very frustrating for me.  I wrote a "wave viewer" program using
wxPython, and my first iteration was on a Macbook pro, and everything worked
great.    But when I ran the same code on a WinXP laptop, I no longer
received the mouse wheel events (and actually, it's the exact same mouse,
because I have the Logitech and I move the USB receiver from Macbook to
laptop).  The wx version is 2.8.12.1 (msw-ansi)  There are some other field
difference (like lower case x for mouse position).
However, all mouse changes are reported as zero.


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.