UWP: How to programmatically retrieve the behavior of Mouse X Buttons - c#

I am developing a UWP App.
We link different behaviors for the different mouse buttons (left, right, middle) and I would like to link also some handlers for the extended buttons (e.g. when we detect a click with PointerUpdateKind.XButton2Pressed).
For the extended buttons, I would like to read the behavior specified by the user and apply the same (e.g. if the user set a default behavior for the extended button 1 via XMouseButtonControl (https://www.highrez.co.uk/downloads/XMouseButtonControl.htm), as the "Copy" action, like CTRL+C, I would like to copy the selected content on the app when the user click on Extended button 1 on our app).
How can I programmatically read such behavior specified by the user within an UWP app?
Is there an UWP API that I can use?

Because the function is provided by the application, so when the extended key is pressed, the specific what to do is by the application.
If you want the user to specify the function of the extended key, you can record the user's personalized settings in the ApplicationData.LocalSettings.
When the XButton is pressed, the corresponding function is enabled according to the current user settings.
Thanks.

Related

Open .Net Maui TimePickerdialog programatically

I am writing a ContentView with an Entry in it. When on IOS or Android I want to open the respective "TimePickerdialog" of the Platform when the user taps the Entry.
On Desktop or when configured in the IOS/Android App, the user should be able to use the Entry to type in the Time by Keyboard.
Is there a way to open it programmatically? I looked at some GitHub repositories where people wrote their TimePickers but it seems, that nobody triggers it programmatically but uses the TimePicker control as the base and not an Entry.
When on IOS or Android I want to open the respective "TimePickerdialog" of the Platform when the user taps the Entry
At first, this design has conflict when the user taps the entry. Usually, the soft keyboard will show when the user taps the entry and trigger the entry's focused event. But you want to open the respective "TimePickerdialog" when user taps it and also want user can input the time by the keyboard.
A touch has two different behaviors, if so, you need to use the custom control and custom render for the each platform to deal with the conflict.
In addition, I think user selecting time is equivalent to user typing time with the keyboard. So you don't have to do a such design.

Trying to detect and gather data on click outside application

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.

How to handle an external HID button click in C#

I'm trying to integrate a third party hardware to one of my existing projects . Basically the hardware has two buttons with different color leds on each button.
I am able to open and close each led with the library/manual which is provided by the manufacturer without any problem. My problem is I can not handle its buttons click events from any kind of software C/C#/VB etc...
I mean when I press one of its buttons it acts like any input device and effects the cursors current position like a keyboard key or mouse click due the opened program(For example if Ms Word is opened currently it acts like space key?). The DLL or manual has no special function for this purpose (like a mouse click event?).
So what I'm asking is there any general way to handle any external device button click inside a C# program? How the currently running software suppose to understand a button is clicked and enter the desired method in the code?
Any clue or tip would be highly appreciated.
Thanks...

wp8 cant find a built-in options menu

Does anybody know if this control comes with the windows phone 8 SDK or if I must program it?
This screen appears when I go to people => click + icon. There are many very similar screens in windows phone but I don't know if they're ready controls or custom ones.
What I need is a screen that hides all background and just shows a list of options upon clicking a certain button, and I want to handle application overflow depending on the option the user chose.
Any ideas?
You can use the CustomMessageBox from toolkit http://phone.codeplex.com
it takes a Content that can be a listbox or user control.
and you can make it take the full screen.
check this: http://shawnoster.com/2012/10/welcome-custommessagebox-to-the-windows-phone-toolkit/
and this: https://stackoverflow.com/a/15944006/1423885

how to get the control of the UI Element Clicked in a external application

How can i get the control (and possibly its text value) of a control which was clicked in another third party application (its not a .net or wpf application for which there are answers which did not solve my problem)
I can get the click event in my app (using the global hooks as mentioned here) i want the control/handle of that particular UI Element
Example : I have opened Notepad and when i click on File Menu, i want the control of that File button.
Look at the documentation for SetWindowsHookEx using the WH_CALLWNDPROC param. This will let you intercept messages in Notepad window procedure. You'll need to figure out which messages get generated from clicking the menu items in Notepad, you can use Spy++ for that. But there is no real control for the File button, it is part of a menu.

Categories