After looking into WinTab, Qt's support for it, and Windows' ink API and real time stylus API, I have taken the initiative to add support for the real time stylus API into the windows platform plugin. Current Qt requires a WinTab driver to be installed to use digitizer data. This is not a requirement for getting tablet input since 2002 (reportedly when Tablet PC SDK and libs were included in XP Tablet PC edition). With the patch applied, I am able to use the tablet example project in Qt to draw from pen input.

Currently supported:
  • Synchronous stylus plugin registered per-window in real time stylus API
  • QTabletEvents emitted for in-air and on-surface movements
  • Precise X/Y and pressure data used (button data digitial only. Need better hardware for verifying additional data)

Todo:
  • Make packet handling robust to use dynamic packet format (windows thing...)
  • Don't allow RTS handler to be created when WinTab handler is used
  • Tap into the mouse handler to allow the tablet code to enable/disable a filter on fake mouse events.
  • Clean up code, remove all warnings
  • Find out proper methods for submitting feature requests/patches to Qt.


Releases

<Old content below, new thread focus>
This issue is mainly with dealing with C, but C#, .NET, w/e would help. I have a program that is reading mouse data from a tablet. I am not using WM_TOUCH messages from the tablet, but rather the mouse position for a pen. I am having issues where there is a slight delay from when you first tap on the screen and when a mouse click message is sent. I have tried using the windows pen/tablet atom to disable automatic pen support to disable TABLET_DISABLE_PRESSANDHOLD | TABLET_DISABLE_PENTAPFEEDBACK | TABLET_DISABLE_PENBARRELFEEDBACK | TABLET_DISABLE_FLICKS, but there is still a delay.

Anyone with a surface (looking at Merth) or other touch device that can see if there is a delay and can be removed? (My testcase is drawing small w's, the beginning of the 'w' is missing. Also, 'I' will have issues with parts of the lines missing.)

I know about the Ink controls, but I am not able to use those controls, I am needing to get the mouse events without delays.

(I am really using Qt, but WM_TOUCH messages for pens are ignored in the windows QPA plugin).
After spending a lot of time researching, I finally found what I needed to understand this. After inspecting messages and DLL/API calls in Windows Journal, I was directed towards the TIS API. I originally got the impression that this API was just for ink controls and their rendering, but was only partly right. InkObj.dll is the frontend to the TIS for getting tablet events, which was not the impression I got from other documentation (Then again, this is MS documentation where they like to contradict themselves).

I should be able to poke around this library and see what goodies it has. Since Qt already has a handler for WinTab-based tablets, it might not be too painful to duplicate it and adapt it to use InkObj instead.
After spending many hours over the weekend, I have some amount of code that allows me to get the tablet demo to run on windows without the wintab driver, something that, as far as my googling has gone, doesn't seem to have been done before.

I'll get screenies posted of the example running when I get a new stable build of my code.
I finally got the driver to a somewhat workable yet unstable stage. I am experiencing crashes inside of rtscom and inkobj when attaching a new RealTimeStylus to an added window (I don't fully know how QWindowsContext::addWindow is called, but for the tablet example, I am getting crashes after making a new instance of the RTS using a HWND made for a menu, probably on a different thread).

However, I do have a screenie as I just got the position translation code working perfectly:


There is still more work to be done, such as ignoring mouse input, filtering out generated mouse events from valid digitizer input, fixing events that are generated without packets being lost, and supporting the rest of the properties that Qt supports.

<edit>
I now see why it was crashing when windows were added. addWindow was called with the HWND of the desktop, which isn't allowed for the RealTimeStylus. I was wondering why 0x00010010 kept showing up, that's the standard HWND returned from GetDesktopWindow.
Patch seems more feature complete now. Only pens are handled, touch and mouse are ignored (handled elsewhere). QTabletEvents now have as much correct data as I can give it that Windows tells me.

Due to an issue in Qt, I don't ignore the synthetic events from Windows. There is no way to tell if the mouse event is from a specific pen, can't get that info. Qt docs say that if you handle a tablet event and accept, that's all you get. If you ignore, then a synthetic mouse event will be sent with data collapsed. Thing is, Windows code just passes mouse events through, meaning you will get mouse events even if you accept, Qt doesn't handle that at all.

With the initial version of the patch, I can finally work on tablet-specific code as well as revising the patch.
I've been working on a drawing widget, hosted on sourceforge. I don't have the windows plugin patch published anywhere as I want to rework it first and get it up-to-date with 5.4.2 (Which should be easy as I don't think that code changed much, if at all).

I'll get screenshots up later on this weekend.
It's that time where I can work on projects again. I'll try and find my patch and see if I can build it against latest stable Qt release (5.6?).
As you know, I've tried to implement Windows' ink API in Qt application. It probably can't be done without some modification to Qt. So I'm looking forward to your patch.

Latest stable Qt release is 5.6, 5.7 should be released in following days.
I've found the windows plugin directory, hopefully that contains all of my changes as the rest of the repo was wiped out a while ago due to lack of storage space. I'm just going to make that available. I don't have the hardware to test the additions and until further notice, I can't continue working on this.

windows-0.0.1.tar.gz
Thank you for your effort. I've found out that when using ink API in Qt application, I can't get pressure from Wacom tablet but I can get it from Microsoft Surface. That's enough for now. Nevertheless, I will look at your patch and maybe try to use it later.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement