This workspace contains several crates (plus some extras, see further below) with different attempts to capture input from my Huion Kamvas Pro 24 Pen Display.
This repo was originally motivated because there was a problem with the windows ink functionality, and therefore the octotablet crate was not working for me. At the time, the only working option was Wintab32, so i spent a lot of time getting that working and ended up publishing the wintab_lite crate. Since then the driver issues have resolved, and all the various attempts below started working for me. Oh well, I learned a lot!
This repo just contains some examples for the various different ways I know to get pen tablet pressure on windows. I would probably recommend using octotablet as your first option through.
-
test_windows_pointer_api(Works!)- Reads
WM_POINTERUPDATEevents (part of the Pointer Input Messages and Notifications API) directly using thewindowscrate
- Reads
-
test_winit_with_octotablet(Works!)- Uses the
octotabletcrate to access pen events, but in a much more abstracted and idiomatic way.winitprovides a much easier mechanisim to create a window. octotabletcurrently provides access via theRealTimeStylusapi which is documented as "Legacy User Interaction Features - ... Windows 7 and Earlier".
- Uses the
-
test_wintab_lite_with_libloading(Works!)- Uses my crate
wintab_liteandlibloading. wintab_litewas originally part of this repo, but can now be found at the links below
- Uses my crate
-
test_wintab_with_bindgen(Works - Terminal Output Only)- uses the wintab interface maintained by Wacom, using
bindgenandlibloading clangmust be installed and theLIBCLANG_PATHenvironment variable must be set- I have distributed the C headers listed below with this repo because I
found them
here
under an
MIT licence
however please note that the headers themselves contain a
copyright notice ¯\(ツ)/¯.
MSGPACK.HPKTDEF.HWINTAB.H
- My code does not close the context properly, so beware potential issues. I was pleasantly supprised that i managed to get this option working at all!
- uses the wintab interface maintained by Wacom, using
-
test_wintab_winit(Works)- Tests the types defined in
wintab_liteby trying to use them withwinit
- Tests the types defined in
For test_windows_pointer_api, test_winit_with_octotab and test_wintab_lite_libloading you will be able to draw in the window that appears
- Mouse input will not draw anything
- Space bar will clear the screen
NOTE:
test_wintab_with_bindgendoes not have the drawing code implemented!
test_print_type_sizescontains python notebooks and experiments used to understandstructmemory layout using the experimental compiler flagrustc -Z print-type-sizes- This little tool is probably worth splitting into its own repository in future, as it turned out to be quite handy.
