Page 1 of 1

Wacom tablet pressure input for cmd

Posted: 21 Dec 2019 19:17
by misol101

so you thought Batch script writers in 2019 was a small interest group? Try Batch script writers with a need for Wacom tablet pressure input! :lol:

Download link: ...

So to start off, unless you have a Wacom Tablet, this program (cmd_wacom_input.exe) will be of no use. Even if you do have one, it might need tweaking, but back to that later.

Also, Wacom tablets can already be used in the cmd window, like a mouse. What is missing is the pressure information.

If cmd_wacom_input.exe is run by itself, it looks like this (when you start using the pad):

This output format is the same as my program cmdgfx_input, because I want to be able to use it with cmdgfx, if need be. The most interesting part is the value after LEFT. In cmdgfx_input, this value is 1 if left mouse button is pressed, but here, the value is 1 up to the pressure maximum (which is 32768 on my Wacom Intuos S). Another notable thing is that the X and Y coordinates are not character coordinates, but pixel coordinates.

As a simple test, I made a very small drawing Batch script (drawChars.bat). Pressing lightly, it will draw dark characters, and pressing hard it will approach white. To make things easier for me, it does use cmdgfx_RGB to draw, but cmdgfx does not have to be used at all, echoing VT-100 codes would work as well (though be slower, I assume)
In order to draw in the correct position, the script forces bitmap font 2 (which is 8x8 pixels), then divides the X and Y coordinates from cmd_wacom_input.exe by 8.

Re: Wacom tablet pressure input for cmd

Posted: 21 Dec 2019 19:33
by misol101
The problem I still have, is that I have reason to believe that the pressure range is different on different Wacom tablets. On mine, it is 0-32768. But so far I have not seen in the WACOM API/test code that I found (which is quite old) any way to determine this range.

It is basically a non-problem considering no-one else than me will probably ever use this program :D , but still... if you do happen to have a Wacom tablet lying around, I would be happy if you could try it with this program and tell me what pressure maximum it gives you (by running cmd_wacom_input.exe by itself, and pressing hard on the tablet and reading the value after LEFT in the output).

Re: Wacom tablet pressure input for cmd

Posted: 24 Dec 2019 19:07
by penpen
The Wacom Forum might be able to answer you that for all Wacom tablets:


Re: Wacom tablet pressure input for cmd

Posted: 25 Dec 2019 06:35
by misol101
Good idea penpen!

Re: Wacom tablet pressure input for cmd

Posted: 04 Jan 2020 13:24
by misol101
Archive update!

Had no luck at the Wacom forum, but eventually when I looked at some more Wacom code samples I found out how to get the pressure range.

The value after LEFT is now scaled to always lie within 0-32767, which means it should work for all Wacom tablets without tweaking.

Also removed a stupid beep sound that I had't noticed because my sound was off :)