Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Detect pen pressure of touch screen

Detect pen pressure of touch screen

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 942 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rock wang
    wrote on last edited by
    #1

    I'm develping a palette app using canvas.
    When drawing line on a touch screen(MS Surface notebook), I want to adjust lineWidth according the pen pressure(thicker or thinner).
    How to achieve this?

    J.HilkJ 1 Reply Last reply
    0
    • R rock wang

      I'm develping a palette app using canvas.
      When drawing line on a touch screen(MS Surface notebook), I want to adjust lineWidth according the pen pressure(thicker or thinner).
      How to achieve this?

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @rock-wang
      that sounds like a very platform specific issue, doubtfull that theres a Qt-api for that, I may be wrong though.

      I would look to Microsoft and c++ accessable pen pressure

      for example this Microsoft forum thread:
      https://social.msdn.microsoft.com/Forums/vstudio/en-US/4fc58526-78c9-4955-a17d-c1dacd90b869/how-is-pressure-of-pen-acquired-in-c-?forum=tabletandtouch


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wrosecrans
        wrote on last edited by
        #3

        I don't have a Surface to test with, but in theory, it should use the same API's as stuff like Wacom tablets: http://doc.qt.io/qt-5/qtwidgets-widgets-tablet-example.html

        QTabletEvent has a pressure() method that you can use to control line thickness of whatever is appropriate for your app. If the tablet example at that link doesn't respond to the Surface pen, then I don't know if there will be an easy way to use it with Qt API's. You might have to look into directly getting native events and mucking around with Windows specific event handling code, which is a bit gross.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved