Wacom tablet pressure input for cmd

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
misol101
Posts: 475
Joined: 02 May 2016 18:20

Wacom tablet pressure input for cmd

#1 Post by misol101 » 21 Dec 2019 19:17

Aaah...

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: http://www.mediafire.com/file/juzr9rwo3 ... t.zip/file

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):
Image

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)
Image
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.
Last edited by misol101 on 21 Dec 2019 19:36, edited 1 time in total.

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: Wacom tablet pressure input for cmd

#2 Post by misol101 » 21 Dec 2019 19:33

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).

penpen
Expert
Posts: 1991
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Wacom tablet pressure input for cmd

#3 Post by penpen » 24 Dec 2019 19:07

The Wacom Forum might be able to answer you that for all Wacom tablets:
http://forum.wacom.eu/

penpen

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: Wacom tablet pressure input for cmd

#4 Post by misol101 » 25 Dec 2019 06:35

Good idea penpen!

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: Wacom tablet pressure input for cmd

#5 Post by misol101 » 04 Jan 2020 13:24

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 :)

Post Reply