c# - Prevent Window Focus Change -
I am trying to help an inefficient person with a small code to make it easier for a game Able to It's limited to a trackball and a button.
Currently he uses the onscreen keyboard and has been able to play other games using it. I have made a small code so that I can try and make my life easier. It uses the hover button for the key when the mouse pointer enters the button, then it sends the key downward when it presses the button, which sends it.
I have this work and I think (or hopefully) she is going to like it. When I tested it, it worked very well.
I want to add another functionality to it if it clicks within my control, so I want to send a different key stroke. There is no problem, I can do this though, when I take that window focus into my control from the game.
I found it on MSDN:
It works to prevent my window from being active, but it still causes the game to lose focus I can set the focus back to the game, but I like if this focus never lost.
I am coding in C # and WPF.
How do somebody have any ideas you can do this?
John Fenton
Hook and keyboard hook in some low level icons, and your The application will not need to focus and give it back.
Take a look, which is on a heavy basis.
Any time you click, anywhere, a second left click is sent, so you double click effectively. Whenever the user clicks, you can achieve your goal by hiding your app so that your app never stops the focus, then locate the location of the click, and decide that one of your buttons is pressed. Or not, and act accordingly
I think I'm digging it from the past, but hopefully someone receives this answer usefully. Cheers, and good for your programming to help a fellow human!
Comments
Post a Comment