I'm working on a project in Silverlight. This is the problem:
When mouse enters in my control, I want to check whether the mouse button is down already or not. There is no way to see when it's been pressed because it might have pressed outside of the browser.
This is a default behavior, thats why mousebuttonup event is used for final actions of your process such as clicking on button does not process its assignment if you release your button outside of the button.
However, you can find a workaround using drag drop features of Silverlight according to your scenario.
Related
I would like to know if it is possible to, while running a WPF window application in Visual Studio, wait for the user to click anywhere on the screen (not necessarily inside the window of my application - for the purpose of my application, the click would most likely occur inside a browser page) and then gather the information about the click (like inside the window of which application the user clicked, or the selector of the html element the user clicked)? I know this question might be very confunsing but this is basically my last resort since researching on the Internet hasn't helped me much. Just to provide a better idea of what I seek, it's like what the 'Extract Structured Data' Activity does in UiPath. Oh and I'm using C# by the way.
You can try and use this external library called GlobalMouseHook.
This library allows you to tap keyboard and mouse, detect and record their activity even when an application is inactive and runs in background.
Here is what you can do with this library:
Mouse coordinates
Mouse buttons clicked
Mouse drag actions
Mouse wheel scrolls
Key presses and releases
Special key states
Hope this helps.
i've new mouse gaming that have several additional button. this mouse doesn't include application to allow user modifying function for the button. i like to change just like sharpkeys do. If there's any application that can allow me, can you tell me what is it? Or if there's no application yet, i im interested to starting developing.
for development choice, i've 2 option, develop with electron(javascript) or c#(the same programming language used by sharpkeys). can you recommend me which one is better?
update:
from this following link
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
we can detect that every button has their own key code, my mouse button additional key code is 3 and 4. how can i modify these key become a same function like home/end in my computer keyboard?
You didn't state clearly about what you want to achieve.
Press a mouse button and act like "go to top of the page" ( what home key does ).
Press a mouse button and act like press home, and press home is defined by yourself.
I'll try to answer both.
According to your link, I found this
For solution 1.
You need mouse button act as "go to the top of page", you shall dig about how to "go to
the top of page".
For solution 2.
Keyboard event will tell you which key is pressed.
You may route mouse event and keyboard event to the same function.
i'm also found other application for alternatives for the solution to my problem, It's Mouse Manager. However, i'm still interested to develop application that can customize the mouse gaming button, for future development.
(Crosspost to Mixed Developer forums because they're still very inactive.)
Going through the HoloToolkit examples, I'm trying to reproduce the button input example in the InputManagerTest example for a GUI I'm making. Reproducing the button seems to cause a hiccup though. Here's what I do:
I add a Canvas
I add a Button to that Canvas
That's basically it. This looks very similar to the example. My scene, as well, as the InputManager, EventSystem, and Camera as instructed in the tutorial.
However, in the example, the button responds to Gaze, and hand click, which is what I want.
In my example, my button responds to my mouse and mouse click though. I also cannot change its color from the default.
Does anyone know why this all would be?
I can answer my own question. Standalone Input Module is automatically added as a component of the Event System in the current build. This sets the default input to be the mouse cursor. Disabling this component fixes the issue.
Hi all i am doing an application in asp.net where when i click on a button i will show an image(loading image) saying that progress is going on. At that time i would like to disable the mouse events completely, so that the user should not perform any operations with mouse. Is is possible to achieve this in Web application if so can any one tell how to achieve this.
my personal preference would be to attach a javascript event which occurs on button click and puts a transparent overlay over the page while the load occurs. The overlay can catch click/move events and discard them.
I have a silverlight control which acts as a drop down. I'd like to get a mouse pressed event when the mouse ISNT hovering over the dropdown control or any one of its children.
how can I go about doing that?
Well that depends on what you mean by "Screen".
With in Silverlight you are only going to be able to detect mouse down when the mouse is over the part of the screen that the Silverlight pluging is actually using.
The first step would be use this code:-
Application.Current.RootVisual.AddHandler(UIElement.MouseLeftButtonDown, myMouseButtonHandlerMethod, true)
This may well be enough for you, however, if you still need to detect mouse down when Popup or ChildWindow controls are in use you will need to attach this handler to those as well (since the sit above the RootVisual).
You may be able to take things further if you want to reach out into Javascript in the host html page. If your SL component only occupies a portion of the HTML Page presented you could get further events from via the HTMLBridge to detect mouse down anywhere in the browser client area.
If you really mean the whole screen then that isn't possible currently.