Crates.io | wintab_lite |
lib.rs | wintab_lite |
version | 1.0.1 |
source | src |
created_at | 2024-04-16 17:02:37.082506 |
updated_at | 2024-04-19 12:14:59.662489 |
description | Read pen tablet pressure with these lightly oxidized wintab bindings |
homepage | |
repository | https://github.com/thehappycheese/wintab_lite |
max_upload_size | |
id | 1210449 |
size | 219,319 |
Defines a minimal set of types to get rust working with wintab.
The original wintab headers and documentation are marked with a copyright notice by Wacom. See here and here. The example code provided by Wacom is MIT licensed here
winit
and the libloading
featurecargo run --example winit_libloading --features="libloading"
Usage:
space
on the keyboard to clear the view.Notes:
-When working in winit
, the native wintab
events (e.g. WT_PACKET
) are
unavailable.
wintab
supports polling methods and keeps a nice timestamped event
queue. YOu only need access to the hwnd
pointer. This is good news as it
means it is likely-ish I can get this working in bevy
, as long as the
plugin lets me have the hwnd
:Pwinit
project is in the process of overhauling how the event loop
works. Hopefully they see fit to make lparam
and wparam
available in the new
system.windows
and the raw-dylib
featurecargo run --example windows_raw_dylib --features="raw-dylib"
Usage:
space
on the keyboard to clear the view.Notes:
#[link(name="Wintab32", kind = "raw-dylib")]
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)
is
critical to avoid hours of painful debugging scaling problems!WTEnable
is currently missing but I will probably add it in a
future update.WTMgrOpen
is missing, but I can't be bothered adding it, because I think it
is not needed unless you are writing a config tool for your tablet device,
or doing really weird advanced stuff. PRs welcome though.libloading
is not necessarily the best option... there are a few others out
there. I would like to find a way to support any of them but I am not sure how.For example; I found that the default LOGCONTEXT object was mostly already
configured as needed. The documentation gave me the impression that more
setup steps should be needed; for example manually measuring the size of the
virtual screen and using that to configure the LOGCONTEXT
object. HOwever
I found that the LOGCONTEXT object generally arrives pre-configured
correctly, so much of the setup in the examples is possibly redundant. Or
perhaps it is worth doing to ensure consistency across different hardware?
bindgen
with wintab.h
An alternative to this crate is to use
bindgen and the original wintab.h
header
files which are avaliable
here. I did not
have a good time with that approach
XYZ
structenum
or using the bitflags
crate.octotablet
cratePlease check out the octotablet
project. At the time of writing it is the goal of this crate to be wrapped by
octotablet
. Currently octotablet
already provides Windows Ink functionality
and support for other platforms.
I did not have good results with windows Ink on my windows 11 machine, and therefore I started work on this crate.