Guide: Getting your tablet working with touch toolbars

Discussion in 'Artists' started by Takanu, Sep 19, 2014.

  1. Takanu

    Takanu Pen Pal - Newbie

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    16
    So, you want to get some lovely touch toolbar action on your shiny new Windows Tablet, but are finding that the touch toolbars aren't working? FEAR NOT FRIENDS, 'cause this is the guide for you! This guide will help you create a touch profile used with scripts based off the Raw Input Control Test, found here: http://39kasen.sakura.ne.jp/rawinputcontroltest/. If you're developing a touch toolbar script anyway, this still might be useful!

    The guide will help you make your tablet compatible with the following toolbars:
    - CHOMP Toolbar (Link)
    - SlatePal (Link)
    - ArtDock (Link)

    There are also at least a few other toolbars that this guide will work for that are unlisted. If you know one that exists that I haven't listed, post here and i'll update it.

    Now this should help most people, but honestly this took a while to figure out, and even then some of the values the touch profiles accept I have no ****ing clue about, the script might as well be running on pixie dust as far as I'm concerned :p

    What you'll need:
    STEP 1 - Install Auto_HotkeyL
    Just go do that. It doesn't matter if you use the 32 or 64-bit version as long as the script youre using isn't packaged into an application. Otherwise, this guide won't work anyway :D

    STEP 2 - Viewing all relevant Human Input Devices on your tablet
    Open the first script in the AHKHID folder. This first script allows you to see the hardware ID for various components on your computer. Click on the 'Other' tab, so you can find the Vendor ID, Product ID, and other information. The most important pieces of information in this list is the Usage and Usage Page numbers. In order to properly enter the next step, you'll have to find what device listed is the touch screen, which may be a trial and error process. The name of the device may give some hints though. For example, the touch screen HID for the Sony VAIO Duo 13 is as follows:

    NTRG0F01&Col02
    Vendor ID - 7062
    Product ID - 3841
    Version Number - 3
    Usage Page - 13
    Usage - 4

    If you cant figure out the device type through the name however, you'll have to note down the usage and usage page numbers of each HID, and move onto the next step.

    STEP 3 - Figuring out the Touch Screen HID
    Okay, now you've noted down the HID name, Usage and Usage Page numbers, time to close the first script and open the second one. Now, start by adding the first HID's UsagePage and Usage numbers in the top-left box. When done, click the 'Add' button next to it. At this point you can set Flags on the left side of the window, but we will leave these until the next step. Now press the, 'Call' button. This will enable the script to start recording the input messages from the HID you're currently testing.
    Now, try tapping the screen and see if any messages are printed in the large box below. If so, you've found the touch screen HID! If not, close the script, re-open it, and test the next HID until you find the HID that does print information when touching the screen.

    STEP 4 - Deciphering the Messages
    Now you have the HID for the touch screen, time to figure out what the messages you're touch screen is sending mean! This is by far the most time-consuming process in figuring out your screen's touch profile, and will require some patience.

    Now, close the second script and open it again. Input the UsagePage and Usage numbers of your touch screen's HID, but before pressing add, view the Flags panel, and tick the RIDEV_INPUTSINK flag, which will ensure that messages are printed even when the script window isn't in the foreground.

    Now, before pressing call, at this point you will need an understanding of Hex Values in order to both decipher the content being printed, as well as to construct the type profile. If you understand them, awesome! If not, read this page: http://www.microbuilder.eu/Tutorials/Fundamentals/Hexadecimal.aspx. It may also help later to have a numeric to hexadecimal number converter. I ended up using this one for my tablet's touch profile: http://www.binaryhexconverter.com/decimal-to-hex-converter

    Done learning all this fun new information? Great! T_T

    Next is understanding what you're looking for in a touch profile. Touch profiles are pieces of code that are at the top of touch toolbar script files, which define how different tablet touch screens send their touch information. If you edit one of these scripts and check near the top of the code, you'll see how they're formatted and laid out. Currently from looking at the code, these are the parameters you can give a touch profile that I managed to work out:

    FirstByte (Required) - The first byte of the raw data in the message sent by the HID.
    RawInputMethod - Used to define an alternate function for extrapolating touch data, if one has been created in the touch profile.
    RawDataSize - The size of the string of data (the character length, not the hexadecimal length to my knowledge)
    RawDataOffset - Used as the current data offset that X and Y get offset by when obtaining values. The offset is the position the data is at inside the message, from the start of the message. The offset for this message is counted by hexadecimal pairs, (halve the amount of characters in this data starts appearing).
    MaxInputs - The number of inputs the touch screen can handle (special Slate500 function only I think, so don't worry!)
    MaxX (Required) - The highest value in X coordinates the touch screen handles (in hexadecimal values of course). The message might not actually produce a maximum X and Y value that works nicely with the touch toolbar, and in this case you'll have to wing it by using the numerical to hexadecimal converter, to find the max values that work best for your touch screen.
    MaxY (Required) - Same as the stat above, but for the Y axis.
    OffsetStat (Required) - Used for finding the hex values that show whether or not the screen is being touched. Offset by the base RawDataOffset value, so if you already have an accurate offset value for the RawDataOffset value, set this to 0.
    OffsetX (Required) - How far into the data string the variables for X and Y are, counted in hexadecimal pairs.
    OffsetY (Required) - Same as the above, but for the Y axis.

    These are some of the parameters I didn't figure out:
    RawDataCount - *shrug*
    RawDataSplitSize - Also used as some kind of data offset value, but i have no earthly idea...
    OffsetTouchID - (Required) - This seems like the variable offset that registers how many touches there are, but im afraid i dont know exactly how to derive this data :/ Initial tests seem to show that this affects how it understands whether you're touching the screen after beginning to touch it. Try using values between 1 and 13
    TouchIdMask (Required) - This is an 8 digit binary number (so, the values are only either 0 or 1). Have no idea what it's used for though.
    TouchIdMinimum - (Required) - Ehh?

    Now the TouchIDMask and TouchIDMinimum seem mandatory, but I really tried understanding this and failed. Look at other touch input examples and experiment, that's all I can recommend sorry.

    Right, still with me here? Okay, now press the Call button on the script window. Experiment by touching the screen in different ways, with a combination of fingers, and in different touch gestures. As you do this, pay close attention to how the hex values in the message change. The change in hex values will start to allow you to decipher what hex values in the message are responsible for what kinds of information, such as the X and Y location of the current screen tap. It would help at this point to keep some written notes on what positions you think the hex values are that send different information about the touch event. Here's the notes I ended up making with the messages my HID sent in order to properly understand what information it was sending:

    [​IMG]

    As you start to build up a touch profile, you can start testing it by adding it at the top of the toolbar script you wanna use it in. You can run it and see if touch starts working. If not, or its working incorrectly, keep testing! This part of the procedure really does suck, but it should be worth it in the end. At some point you'll figure out what everything in the HID message is, and touch input will work nicely. Just hang in there!

    Some of the variables ive described as things I don't understand i'm pretty sure are needed to ensure complete compatibility with your tablet, and as a result there might be bugs or other inconsistencies. If anyone has any other information that would help understand what these variables are for, that would be awesome :D
     
    Last edited: Dec 1, 2014
    jaekqubp, cleft and ron2k_1 like this.
  2. ron2k_1

    ron2k_1 calibuchi Senior Member

    Messages:
    1,013
    Likes Received:
    173
    Trophy Points:
    81
    As soon as I have a chance I'll be trying this on my x230t

    Swiped from my Galaxy Note 8 using Tapatalk
     
  3. Steve B

    Steve B Moderator Moderator

    Messages:
    3,226
    Likes Received:
    404
    Trophy Points:
    151
    If the x230t could have a toolbar such as one of these, it would be one of the best workhorse tablets available.
     
  4. Takanu

    Takanu Pen Pal - Newbie

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    16
    Cool, let me know how this goes, it should work on any tablet regardless of whether it uses N-Trig or Wacom pressure sensitive technology :)
     
  5. cleft

    cleft Scribbler - Standard Member

    Messages:
    313
    Likes Received:
    55
    Trophy Points:
    41
    @Takanu
    Thank you very much for an utterly informative post! I had never made that far in studying the parameters and gave up on my x201t shortly after learning that HID was not the trouble maker. Hope it would go better this time!
     
  6. ron2k_1

    ron2k_1 calibuchi Senior Member

    Messages:
    1,013
    Likes Received:
    173
    Trophy Points:
    81
    Yeah. It'd be awesome if we'd get this thing going again.

    But although the OP made a lot of research and kind of encourage you to try it in your device. There are still lots of required data elements that are unknown. If somebody knows any of them and care to share some details, please do so.

    Swiped from my Galaxy Note 8 using Tapatalk
     
  7. Takanu

    Takanu Pen Pal - Newbie

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    16
    The data points that aren't known aren't too hard to find after experimentation. In fact I haven't actually been able to deduce whether the TouchIDMask or TouchIDMinimum have an effect on the touch profile, but every other touch profile has the pair, and from looking on the code it does seem to have some significance. Only the TouchIDOffset seems to directly affect touch, although this is just from experimenting on the VAIO Duo 13.

    If anyone tries to create a touch profile for their device and make any observations as to how these 3 variables affect the touch input, please post here what you find so their functions can be deduced :)
     
    Last edited: Sep 22, 2014
  8. lblb

    lblb Scribbler - Standard Member Senior Member

    Messages:
    1,177
    Likes Received:
    235
    Trophy Points:
    81
    Hi Takanu,

    Great contribution. I'll try to write back later as I'm not really here right now!

    I'm sure you've looked at these but have you looked into the two tools that the original developer Koide developed to come up with profiles? See the two tools that I link to in the following post:
    http://forum.tabletpcreview.com/thr...patibility-and-links.58400/page-2#post-343381

    In particular, it seems like the Test_Diagnostic_Tool may be useful in figuring out parts of the RawInput data.

    Cheers!
     
  9. Takanu

    Takanu Pen Pal - Newbie

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    16
    I looked at the Test Diagnostic Tool and it definitely is helpful, I haven't had the time to add how it's used into the guide but I will do soon. It basically tries to find the touch screen HID details for you, as well as prints out the touch screen message in pairs of hexadecimal values. It also tries to find the Max X and Y values for you.
     
    Last edited: Sep 22, 2014
  10. VertPusher

    VertPusher Pen Pal - Newbie

    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    6
    Hi Takanu,

    Thank you posting this guide. It is a great starting point and really helped demystify some of the seemingly complex code in these toolbar scripts.
    I have a Surface Pro 3 and I think Ive been able to get most of these toolbars working now.

    I think many of the profile values are very similar to your default ones.
    the one main thing I changed when creating the surface pro 3 profile was the MaxX and MaxY values.

    I used the RawInputControlTest_Diagnostic_Tool with a x=6 and y=10 offset to obtain the proper max dimensions for the SP3
    x =9600 y=7200 and then used the link you provided ( http://www.binaryhexconverter.com/decimal-to-hex-converter )to convert those values to their Hex equivalent.

    Below is the SP3 profile I'm currently using for the touch toolbars.

    (
    #Profile:Microsoft Surface Pro 3 (default)
    FirstByte=0x03
    RawDataSize=27
    RawDataOffset=3
    MaxX=0x2580
    MaxY=0x1C20
    OffsetStat=0
    TouchIdMask=11111111
    TouchIdMinimum=0
    OffsetTouchId=1
    OffsetStat=0
    OffsetX=3
    OffsetY=7
    )

    Some of these values might be incorrect (like the TouchIdMask) but I haven't noticed any wonky behavior yet.
    if anyone else has figured out some better values please post them.
     
    Takanu likes this.
Loading...

Share This Page