AdvancedHMI Software
General Category => Support Questions => Topic started by: authorleon on March 08, 2018, 01:15:37 PM
-
Hello,
I have a very simple form which uses a few buttons to directly control the outputs on an SLC500.
I have a piece of code which allows you to have hotkeys but only when you are focused on the form.
Is there a simple way to have global hotkeys. i.e. CTRL + ALT + SHIFT + U (Mover motor up).
I have been trying for the last six months on and off but unfortunately no success.
-
Is it possible to have a piece of code that emulates pressing the button.
I can get one working but you have to be focused on the form...
Can anyone really help me with this???
-
See if any of these might help:
https://gist.github.com/kirsbo/3b01a1412311e7a1d565
http://www.dreamincode.net/forums/topic/94406-global-hotkey/
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c1a24688-d844-4adc-9d85-416a7158c6ba/faq-how-do-i-register-a-hotkey-in-vbnet?forum=vbgeneral
-
Hello,
Thank you very much for the information.
I have had a look at the links and I do have the global hotkeys. But I have a problem maybe somebody can help you with.
I am using the buttons in the application.
So when I press the button. It activates the appropriate output.
When I release the button, it deactivates that same output.
So physically pressing the buttons works perfectly.
I am using the buttons not as a toggle. When you press and hold the button the output stays on. When you release the button it turns off.
I cannot find any release function at all in VB.
Does anyone know of a special trick, hack or whatever to get this working.
I am willing to pay as well, if only I could have just a piece of code and then I can integrated.
I really appreciated and I really need to find a solution. Thank you very much
-
Just use the MouseUp event.
Private Sub BasicButton1_MouseUp(sender As Object, e As MouseEventArgs) Handles BasicButton1.MouseUp
'Put your code here'
End Sub