How can I control cursor from software? - winapi

Basically, I want to develop a software that can move and control cursor without using mouse. But I have no idea what to start. I have a rough idea that call the windows API using C/C++. Can anybody give some tutorial or hint?
Thank you very much!

You can find out where the mouse pointer is using GetCursorPos, move it using SetCursorPos, and send mouse clicks using SendInput. There's an example of using each of them from the linked pages.

Related

If Steam can map the guide button on the Xbox 360 controller why can't I

I want to map the Xbox Guide button on the Xbox 360 controller.
I've been searching for a possible solution for some time now and from the looks of my google results it seems that the only way to do so is by using a custom driver.
However, I tried using Steam Big Picture mode today and was surprised to see that Valve has managed to achieve this to open the Steam Overlay. So how come I can't find any information on how to do this? Does anyone have any idea of how they've done it?
I've thought of possible solutions, aside from a custom driver, and I wonder if you could read the raw data from the controller? The button must send a signal so it should be possible detect when it's pressed, right?
Any help is much appreciated.
To mark as answered: #luke answered this in the comments with:
Assuming you are using XInput, it appears that use of the Guide button
is undocumented. However, people have figured out that it apparently
sets bit 0x0400 in the button bit flag. More information.

How to trigger the On-Screen-Keyboard in Windows 7 by clicking on an input?

Well, I'd like to show up the On-Screen-Keyboard when the user clicks onto any control which needs a text-input. System-wide.
The reason: I am using a touchscreen for some projects I've been working on and needed to open the On-Screen-Keyboard manually every time me or someone else had to type something.
Are there any possibilities, capturing a system-wide event for that? Thanks in advance for your help and suggestions!
I am currently looking into a solution like this. It's been a feature well implemented on mobile platforms, but nothing on the desktop! Hopefully something will come along as a result of the Touch Centric strategy for Windows 8.
The closest, but most expensive thing I found is M T Soft TS Keyboard http://www.imgpresents.com/mtsts/mtsts.htm?babelfish=translate

How to create custom onscreen keyboards?

Im about to start creating a custom onscreen keyboard for my WP7 app. An out of the box SIP will not work since they can't be customized or built from scratch with .NET.
Ideally the keyboard would activate like a SIP. Specifically, appear when the textbox receives focus. Docking to the bottom of the screen would be nice, too.
Any ideas where I could find samples of this?
Also, do you have any recommendations or lessons learned you could share?
I think you'll be making this sample ;)
The challenge with letting textbox take focus is likely going to be the built in SIP is going to appear. ReadOnly is an option, but you'll either lose or need to find a way to retain/mimic the cursor if that visual queue is important to you.

Change the Cursor Image on Mac irrespective of which applicatoin is on Top

I want to Change the Cursor Image on Mac irrespective of which application is on Top or in focus.
Can some one direct to related source code or some hints would be helpful?
I am using Carbon, C++
Thanks
Rahul
I don't think it is possible, and I think that is a good thing. The cursor image often provides information from the current application to the user, and background apps should not interfere with that communication.

Globally hide mouse cursor in Cocoa/Carbon?

Is there a way to globally hide the mouse cursor for all apps in Cocoa (or Carbon)? Or at least replace it with something else?
EDIT: Thanks for the input guys, but turns out Daniel Jalkut found the solution a while ago :) http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html
You are looking for CGDisplayHideCursor, which is part of the Quartz Display Services API.
Check out: http://developer.apple.com/legacy/mac/library/samplecode/CarbonCocoa_PictureCursor/listing2.html
It's an old sample, but probably still works.
I expect that you're going to be limited to your application window, however. If you want to hide it for everyone you will probably have to make your window cover the screen.
Fun fact: The old toolbox function was simply "HideCursor()".
just add this to your code:
CGDisplayHideCursor (kCGNullDirectDisplay);
No, I don't believe there's a way of doing what you want, short of showing a full screen window and then obscuring absolutely everything on the desktop. That would also prevent e.g. keystrokes being sent to the right application and the like.

Resources