Right clicking on plot to zoom in Bokeh - python

I recently started using Bokeh. Overall I am very satisfied. One thing I find annoying though is that it seems I can only play with the left mouse button and need to manually switch tools everytime I want to pan/zoom/etc... It would be great if I could pan with left mouse buttom and zoom in with right mouse button. Is there a way to automatically 'switch' to zoom tool whenever right mouse button held, and switch back when left mouse button held?
Thanks!

Related

Detect Non-Standard Mouse Left and Right Scroll Click using Python

I want to read mouse left and right scroll click events and simulate them in Python in windows. I know I can detect and simulate the default ones such as middle mouse button, vertical and horizontal scroll using the virtual-key codes defined here:
https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
However, those do not correspond to the non-standardized so called "Repeat Scroll Left" and "Repeat Scroll Right" buttons on my Razer Basilisk V3 which I can activate by clicking the scroll wheel to the left and right. I have tried the AHK method to detect the key codes here with no luck:
https://superuser.com/a/1154645
How would I detect these click events on windows? Are there virtual-key codes for these buttons? If not how would I detect and simulate these buttons in Python ctypes?

scrollhandrag keep on pressing after click

I added scrollhandrag for my pan tool function with self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag). It is working just fine but when I added some in my mouseReleaseEvent to add Ellipse after releasing the mouse, the scrollhandrag function stop working. When I clicked the mouse, it will drag the screen but when I unclicked the mouse, the hand won't open/uncliked and it keeps on dragging the screen. How can I make the scrollhandrag to unclick when I am no longer pressing my mouse without deleting my mouseReleaseEvent?

Is it possible to move and click the mouse in an inactive window with Python?

Is there a way to make the mouse move to certain coordinates and click inside of a window that might be in the background or behind another window without losing focus.
The idea is to let it work in the background while I'm using the computer for something else.
I'm working with Python on Windows 10.

Python [Canvas]: Detect Mouse Button NOT pressed

My question today is, that I'd like to know, if there's a way to detect a mouse button NOT pressed using canvas.bind().
I want to know that, because I want to save data while a button is pressed, and to stop saving data when the button is not pressed anymore.
I want to do this with the left mouse button / ''
If you don't know what I wan't to do; feel free to ask in the comments :/
Detect mouse press and release events. When one of those events occur, start or stop saving as appropriate.
canvas.bind("<Button-1>", start_saving)
canvas.bind("<ButtonRelease-1>", stop_saving)

How to change my wx.toolbar event?

I have a wx.toolbar with some buttons. One of the buttons makes pan left!
I want to click on the button and while I keep it pressed, the pan left is made.
For now I only saw that the wx.EVT_TOOL only works when mouse left is up.
Is there a way to do what I intend ?
In the toolbar button's event, you should be able to get the state of the mouse via wx.GetMouseState.
Alternatively, you can make your own toolbar with a panel and some wx.Buttons (or other button widgets).

Categories

Resources