0

From what I've researched it seems I can get the mouse position using GetCursorPos(); and differentiate if the input is from the mouse using GetMessageExtraInfo();.

The problem is that I wish to be able to move the cursor regardless of the pen's position. The goal is for my program to be able to read the pen's position while my OS (Windows 10) ignores its input. This way I can move the cursor independently of my pen's position.

Essentially I wish to use the pen's position (as reference) to move the cursor on specified areas of the screen.

The Tablet PC in which I desire to implement this is a Thinkpad X220t.

Jose Cancel
  • 151
  • 1
  • 2
  • 15
  • These two statements seem contradictory: *"This way I can move the cursor independently of my pen's position."* and *"Essentially I wish to use the pen's position to move the cursor on specified areas of the screen."* – Cody Gray - on strike Jun 25 '17 at 11:37
  • @CodyGray I wish to use the pen's position as a reference. This way the cursor isn't directly positioned where the pen is pointing. – Jose Cancel Jun 25 '17 at 11:41
  • You can just hide system cursor and draw your own instead. – user7860670 Jun 25 '17 at 12:17
  • @VTT Hide my system cursor? Didn't know I could do that. If I understood you correctly, there is a way to momentarily hide the default cursor and create one through C++ using the pen's position as a reference? – Jose Cancel Jun 25 '17 at 12:23
  • There is a dedicated [`ShowCursor` function](https://msdn.microsoft.com/en-us/library/windows/desktop/ms648396(v=vs.85).aspx) just for this. – user7860670 Jun 25 '17 at 12:40
  • @VTT But from what I read that only shows/hides the cursor. It doesn't let me create another cursor that can be moved with private values. AKA: Independently from the pen's position (or an external mouse/trackpad). Or can it? – Jose Cancel Jun 25 '17 at 12:46
  • Yes, it only shows/hides system cursor. You need to draw new cursor yourself. – user7860670 Jun 25 '17 at 12:58
  • @VTT Oh, I didn't know I could create additional cursors (apart from the system cursor). How can I create a new cursor through C++? (that is moved independently from the pen's (or mouse) input). Will I still be able to get the pen's position so that I can use it as a reference to dynamically move the new cursor? – Jose Cancel Jun 25 '17 at 13:08
  • You need to manually draw it at desired position using some graphical API that is used in your application. – user7860670 Jun 25 '17 at 17:24
  • Do you want to implement this for your application, or as a system-wide service? – IInspectable Jun 25 '17 at 20:45
  • @IInspectable I wish for this new cursor to be recognized by other applications (not just my own). – Jose Cancel Jun 25 '17 at 20:51

0 Answers0