Detect mouse cursor icon change in application - vb.net

I've been looking for awhile now to no avail for this.
What I'm trying to do is find a way to detect if a mouse icon changes when you mouse over something.
For example: If you mouse over a link it changes from the arrow to a finger.
My plan is to grab the ID of a window, and scan it for clickable objects based on the mouse icon changing. I can grab the window, bring it to the front, and move the mouse around by setting the x,y coord of the mouse, but I don't see a way to detect if the mouse has found anything.
I would prefer this to be something built into vb.net, but if I have to use an API I'm fine with that.

The approach is wrong because the concepts are different from what you observe visually.
There's no such thing as "click" -- there's Button Down event (Windows message sent by the GUI subsystem to the application), Button Up event and Mouse Move event. If there were Button Down and Button Up with no or little Mouse Move, then the OS considers this a click.
All events are sent to the window under the mouse cursor hotspot unless the mouse input is captured by the other window.
When the cursor is moved over the window, the OS sends WM_NCHITTEST message to the window to determine, how the window treats the area under the cursor. Based on window's response Windows either performs the window operation (window move or resize etc) or passes mouse-related events to the window procedure. The procedure then decides how to react - do nothing, make visual changes, perform some action etc.
As you can see from the description, cursor change and actual actions are two different loosely related operations. There can be an action without cursor change or cursor change without an action.

Related

PySide2 Tear Off Tabs

The project is to have a main window GUI with tabs, and the ability to tear off tabs into their own floating main windows. Exactly like the Chrome browser I'm using right now (probably most/all browsers do this). Using Windows 10, Python 3.7.7, PySide2 5.15.0.
I'm looking at similar questions here and elsewhere that use the native C++. They all seem to have one thing in common: Picking up mouse events on the tab.
I can create a subclassed QTabWidget and do all the things that pick up mouse events, for instance, putting a "installEventFilter()" in the class' "__init__()", and an "eventFilter()" function. Or simply overriding the "event()" function. I can pick up all kinds of events, including mouse events, but not on the tabs. Click/move in the tab view, yes; click/move next to the existing tabs on the tab bar, yes; but click/move on the tabs themselves produces "Paint" events. This is correct, as the tab view must be repainted when the tab is selected. But I can't pick up a mouse event for use in the dragging techniques I see in the C++ code. I can't pick up the mouse event that results in the Paint event.
Apparently, in native C++, the mouse events can be intercepted before they get to the tabs. I'm not seeing a way to intercept mouse events on the tabs in PySide2.

Labview button freezes after pressed once

I'm trying to program something to read voltage from the Labview ULx library and add the voltage into an array. I tried to do so using an event structure while setting a boolean button 's mechanical action to "Latch when pressed". However, the "Latch when pressed" option seems doesn't work and the program reads the voltage and adds it to the array correctly and it freezes.
front panel
Block diagram:
When you use a Value Changed event with a latched Boolean control, you need to read the control's value inside the event structure in order to reset the latch.
Just move the Sample control's terminal inside the event structure, then it should work as you expect.
Tip: you are free to use the Latch When Pressed action if you want, but the standard action for UI buttons in the OS (Windows etc) is actually Latch When Released. You can check this by clicking on a button, dragging the mouse pointer off the button and then releasing it - the button shouldn't operate. You might want to decide which one makes more sense for your application.

Scroll using the mouse in nano editor?

Probably not the right place to ask this question, but I couldn't find the answer anywhere. As the title says, is there a way to enable mouse wheel scrolling in the nano editor? (specifically ubuntu 14.04)
Nano doesn't support using the mouse wheel to scroll. You can enable nano's (limited) mouse support with alt-M or with --mouse when starting nano (another invocation returns to whatever mouse support your terminal has), but that's it:
−m, −−mouse
Enable mouse support, if available for your system. When enabled, mouse clicks can be used to place the cursor, set the mark (with a double click), and execute shortcuts. The mouse will work in the X Window System, and on the console when gpm is running. Text can still be selected through dragging by holding down the Shift key.
(https://www.nano-editor.org/dist/v2.6/nano.1.html)
By default, mouse services are provided by the terminal window. The mouse works almost the same as in a GUI editor. You can highlight text, right-click to copy and paste, and use the middle mouse button for pasting text from the buffer. However, when you use the middle mouse button to paste text, the text is pasted at the current cursor location, not at the mouse pointer location. Other limitations exist. For example, you cannot use the mouse to cut or delete text, nor can you use the mouse to scroll through the file.
Nano has its own built-in mouse services, but they are limited. They provide only the ability to move the cursor to the point where you click, and to mark the beginning and end of a section of text. Use the Alt-M key combination to toggle between using the terminal's mouse services and nano's built-in mouse services.
(https://help.ubuntu.com/community/Nano)
To scroll by mouse: toggle mouse support OFF: Alt + m, or Esc m. The caveat is, it will also reposition the cursor.
Of course once mouse support is disabled, using the mouse to position the cursor will no longer be possible. The simple workaround is to toggle mouse on/off as needed.
The reason this works is because, with mouse support disabled in nano, it falls back on the terminal to handle the mouse. It does this by printing to the screen whatever input it receives from the mouse as a stream of escape sequences. Since these escape sequences are standard, nano knows exactly what to do with them and positions the cursor accordingly.

cocoa mousedown on a window and mouse up in another

I am developping a Cocoa application and I have a special need. In my main window, when I mouse down on a certain area, a new window (like a complex tooltip) appears. I want to be able to do:
- mouse down on the main window (mouse button stay pressed)
- user moves the mouse on the "tooltip" window and mouseup on it.
My issue is that the tooltip window does nto get any mousevent until the mouseup.
How can I fix this?
Thanks in advance for your help,
Regards,
And it won't since mouse is tracked by the main window. However, you can process mouseUp in the main window, transform click coordinates into the desktop space, get tooltip window frame and check whether the click occurred on the tooltip. After that, you can send a message to the tooltip window manually.
Or you can try to find another way to implement the final goal :) It is usually better to follow the rules, in this case - mouse tracking.

VB.NET Minesweeper issue

I have fully programmed my Minesweeper; however, I was having difficulty trying to get the same result as in the original minesweeper for when a user clicks and moves the mouse around while still right clicking. You may notice that in the original Minesweeper, when a user does as explained, the tiles that the user goes to will then look blank. If the user releases the mouse, the current tile they hovered to will become the clicked tile. In my Minesweeper, the tile I click on is the only one that will look blank, and when I hover over to the next tiles, they do not get blank like the first one I clicked on. Then when I release my mouse button when over to another tile, the very first tile I clicked on is the one that gets uncovered. Here is what I already have used. I have the MouseDown event which checks to see if the game has been started to begin the game timer. It also has some color properties for tiles when I click on them and I set a boolean to true or false depending on the user left or right click. I have the MouseUp event which looks at the boolean to determin what the user had clicked on the mouse so I know if I flag or simply click to uncover. Then I have the MouseEnter and MouseLeave which are needed to yield the proper glow I want for the tiles. What should I do to get the same results as in the original Minesweeper with the MouseDown and MouseEnter into other tiles? I tried many other things such as MouseEnter, MouseMove and MouseHover, but all seem to yield the same crummy result as what I already have.
Just another piece of information, the MouseEvents are built in to a UserControl which I then use as my tile in Minesweeper. It almost as if when an event is active, another one cannot be done at the same time.
You might want to consider, DragOver and Drag related events