mousewheel

Chrome - Javascript prevent default Ctrl + MouseWheel behavior

有些话、适合烂在心里 提交于 2019-12-07 10:54:20
问题 I'm trying to prevent the default Ctrl + MouseWheel zoom behavior in Chrome with JavaScript, for the other browsers I use preventDefault() and stopPropagation() in the callback function for mouse-wheel event and works perfect because the other browser always trigger a mouse-wheel event but Chrome does not. Reading the question How to catch Zoom event with GWT and Chrome I found that Ctrl + MouseWheel can be caught as a resize event but after zooming the page so I can't prevent the behavior

How to implement MouseWheelListener for JPanel without breaking its default implementation?

最后都变了- 提交于 2019-12-07 07:53:25
问题 Simply; I have a JPanel inside a JScrollPane ; As expected; JScrollPane by default listens to MouseWheelEvent so that scrolling is working well for when the wheel is rotating and while the cursor is hovering over the JPanel . But After that; I just updated JPanel so that it implements MouseWheelListener , and I added this mouse wheel listener for the JPanel itself. @Override public void mouseWheelMoved(MouseWheelEvent e) { if (e.isControlDown()) { if (e.getWheelRotation() < 0) { System.out

HTML content only scrolls with scrollbar, not mouse wheel

百般思念 提交于 2019-12-07 01:38:37
问题 I have a <div> on my page with a fixed height, and overflow-y: scroll; set so that the content will scroll when it passes the bottom edge of the <div> . Nothing out of the ordinary. For some bizarre reason, the mouse wheel will only scroll the content if the cursor is over empty space in the <div> or if it's over the scrollbar itself. If the cursor happens to be over any of the text content in the <div> , the mouse wheel won't do anything. This happens in both Firefox and Chrome, so it isn't

Mouse wheel not working when over ScrollViewer's child controls

送分小仙女□ 提交于 2019-12-06 23:49:32
问题 I was kind of expecting my ScrollViewer's child controls to hand the MouseWheel events back up the the ScrollViewer automatically, and that's not the case. I have a ScrollViewer with a ListBox in it. If I manually resize the width of the ListBox to be less than the ScrollViewer, the MouseWheel works on all of the ScrollViewer but has no effect when the mouse is positioned above the ListBox. What's the standard way to do this? Do I put an event trigger on the ListBox that fires the event on

Bubbling scroll/mousewheel event

我的未来我决定 提交于 2019-12-06 15:27:25
问题 I've setup my app/website such that I have an absolute-positioned canvas element on top of a scrollpanel, when the scrollpanel scrolls I apply on offset to the canvas to make it look like the image is scrolling (this allows me to have huge canvas without the overhead of a huge canvas element). The problem is, when my mouse is over the canvas element, the scroll wheel does not work, since the scroll event does not bubble. In this case, however, I need the bubbling to get the scrollbar to work.

Qt 5 : Mouse Wheel event behaviour for zooming image

丶灬走出姿态 提交于 2019-12-06 15:06:45
I have a window, in which is a QGraphicsView, which will be displaying an image. I have implemented the wheelEvent(). My images are mostly going to be bigger than the window, so I get scroll bars in the window. What we normally observe when we rotate the wheel while viewing an image in Windows Photo Viewer is that when we move the wheel up (towards it's wire), the image zooms in and when we move it down (towards out body), the image zooms out. What I am getting instead is when I move the wheel towards myself (to zoom out) the image instead of zooming out , first scrolls down, and starts

How to prevent focused control from scrolling when the mouse isn't over it?

梦想与她 提交于 2019-12-06 13:34:24
Refer to this prior related question . While the answers there do work, I have further issues when it comes to certain types of controls such as a TDBGrid . If the TDBGrid currently has focus, but the mouse is pointed over another control to scroll, the TDBGrid scrolls anyway, thus resulting in two different controls scrolling at the same time. This happens in every single solution which I've found so far related to scrolling the control underneath the mouse. How can I prevent this behavior and ensure that only the control under the mouse scrolls, and nothing else? This code works fine for me.

Detecting mousewheel over non-focused window?

前提是你 提交于 2019-12-06 12:51:10
问题 My goal is to make a floating toolbar (as its own C# application), and when the user uses the scrollwheel over me I want to change the buttons that are visible. Sounds easy enough, should just be a matter of this one-liner: MouseWheel += new MouseEventHandler(Form1_MouseWheel); The problem I am having is that the mouse wheel handler is only invoked when my application has focus. That means the user has to first click, and then mousewheel. That won't do for what I'm trying to do. I can hook

Detecting Horizontal Mouse Wheel movement

末鹿安然 提交于 2019-12-06 10:20:08
问题 I am using the mousewheel in my DotNet application, which I have done by following: MSDN MouseWheel example But on my application it would be great to also use the existing hardware horizontal mouse wheel too. But how can I detect when this is used in .Net? I am using Logitech RX1500 or or m-RAG97. Regards - * Solution * Override the WinProc to catch the mouse wheel event. MustInherit Class Win32Messages Public Const WM_MOUSEHWHEEL As Integer = &H20e 'discovered via Spy++ End Class Protected

Zooming of an image using mousewheel.

我怕爱的太早我们不能终老 提交于 2019-12-06 07:53:36
问题 In the code below I am trying to zoom the image via a mouse wheel. But the code is not working properly, it is just refreshing the panel but it does not resize it. Actually I am taking the image from memory stream that is created by another class called as decrypt. Complete Image is displayed properly but I am not able to performing zooming of the image using mousewheel event. Plz help Me. private void Form2_Load(object sender, EventArgs e) { this.Width = Screen.PrimaryScreen.WorkingArea