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_POINTERUPDATE
events (part of the Pointer Input Messages and Notifications API) directly using thewindows
crate
- Reads
-
test_winit_with_octotablet
(Works!)- Uses the
octotablet
crate to access pen events, but in a much more abstracted and idiomatic way.winit
provides a much easier mechanisim to create a window. octotablet
currently provides access via theRealTimeStylus
api which is documented as "Legacy User Interaction Features - ... Windows 7 and Earlier".
- Uses the
-
test_wintab_lite_with_libloading
(Works!)- Uses my crate
wintab_lite
andlibloading
. wintab_lite
was 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
bindgen
andlibloading
clang
must be installed and theLIBCLANG_PATH
environment 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.H
PKTDEF.H
WINTAB.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_lite
by 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_bindgen
does not have the drawing code implemented!
test_print_type_sizes
contains python notebooks and experiments used to understandstruct
memory 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.