Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Tristan Schaaf
    @albinekb I completly forgot that macbooks have forcetouch nowadays :P I know that everybrowser is "bascially safari with a skin" on iOS. I've seen skins crapping things up though.
    Viajar a Argentina
    Hi guys, I'd like to ask why pressurejs.com doesn't work in my tablet device with Debian
    The pressure with my stylus pen is working in GIMP (i.e) but not with pressurejs.com, any ideas on this?
    I'm using Firefox 52.5.0 (64-bit) and Chromium
    Stuart Yamartino
    @enargentinahora_twitter what about it does not work? When you go to the docs do the circles expand when you touch and hold? Is that broken or do you mean you can't give variable pressure and have it change?
    It's likely force is not passed through to your browser on that device.
    Viajar a Argentina

    @stuyam I have Debian Stretch installed in my Asus T102H. With Firefox 52.5.0 (64-bit) the circle (or the other features) aren't working at all. Not even the "div alert" when the device has not support on force/touch.

    With Chromium 62.0.3202.89 (64b) the circle expands but here the message appears (Your device does not support force touch or 3d touch... back to the polyfill)

    Pressure is working on the device, I've tested it with evemu-record and draw things on GIMP, the event is presented in linux as ABS_PRESSURE (with evemu-record) with a range of values and it's respective X,Y values.

    Basically I want to know what is expecting pressurejs from my OS/Browser to detect the pressure capability.

    @stuyam "It's likely force is not passed through to your browser on that device." Any advice? :) how I enable my navigator to deliver that data to the web app?
    Aaron Heuckroth
    Holy shit. I just discovered this library and I am so freaking excited.
    I built an app for getting references for gesture drawing recently, and wished I could have actually integrated a canvas with pressure sensitivity... and now I can! Whee!
    Stuart Yamartino
    Thanks awesome @Nesciosquid happy to hear it!
    @enargentinahora_twitter whether the browser supports getting a force value from the device is out of the control of Javascript. Some browsers support it and some don't even if the device supports it outside of the browser.
    As for the Firefox issue, would you mind opening that as an issue on GitHub so we can further investigate why even the polyfill isn't working?
    Aaron Heuckroth
    Proof of concept is up here: http://www.heuckroth.com/gesture/draw
    Seems to work pretty nicely on iPad with safari + pencil.
    Aaron Heuckroth
    @stuyam , d'you know of any online drawing apps that use pressure.js? I wasn't able to find any
    Stuart Yamartino
    @Nesciosquid holy smokes thats an awesome proof of concept! Id be happy to feature something like that on the pressure homepage when you have a result you are happy with. I could even just iframe it in :thumbsup:
    I don't know of any other drawing apps of the top of my head, people always ask about it but I have not seen any examples
    Aaron Heuckroth
    Hee, thanks! I'm working on abstracting the canvas + pressure interaction out into a nice React component library.
    The UI is obviously still placeholder, but I've made a some progress on features + optimization of the drawing surface: https://draw.aran.ink/draw
    @stuyam , I was wondering if you had any recommendations for differentiating stylus input from other touch input. With native drawing apps on the iPad, it's super helpful to exclude erroneous touches (from the hand and fingers). I could probably do that by using something like a Kalman filter to guess whether any new touch is relevant to the current stroke, but if there's a more canonical solution, it'd be great to hear about it.
    Stuart Yamartino
    @Nesciosquid definitely. If the device supports pointer events that is. If they support pointer events you can use the pointerType to get if it is a mouse, touch, or pen event: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
    Aaron Heuckroth
    Interesting! In this case I'm particularly interested in the Apple pencil + iPad combo, which I think cause TouchEvents, not PointerEvents, but maybe they do both?
    Alex Chan
    Really cool library!
    Ray Frihy
    Hey guys this looks sick, Is there something I have to do/download to get it to work with a Wacom tablet in chrome(Windows 10)? The pressure test seems to work on my Note4 just fine, Thanks :D
    Stuart Yamartino
    Do you have the Wacom software installed on your computer? If so then Chrome on Windows might no support it unfortunately
    Aaron Heuckroth
    Fairly certain I've seen it work with Chrome on Windows.
    damn!!!! its fucking sick
    Aaron Heuckroth
    @stuyam Is there a way to determine whether the input is coming from a touch event (fingers) vs. a stylus (wacom, pencil)?
    Automatically converting touch time to pressure is nice, but it'd be super useful for palm-rejection to be able to disregard anything that isn't actually a stylus.
    Oh, I guess I could use "only('pointer')" option. I'd kinda hoped to be able to toggle it on and off with a setting, though I suppose I could still do that by re-initializing Pressure...
    Aaron Heuckroth
    Ended up answering my own question -- I use pressure.js only for tracking the pressure info, then used separate onTouch / onMouse handlers for the actual drawing. Then, I only allowed drawing for pointer events and touch events where the touch event 'type' was stylus (or something like that -- it's an Apple-specific thing, I think?)
    Any support for Huion?
    Stuart Yamartino
    Awesome @Nesciosquid glad you figured it out! Cool use case.
    @Pesoptim haven't used Huion before but as long as the browser you are using it with supports the Huion pressure as pointer pressure then it should work.
    Ayan Murad
    i want to use measure weight via my mobile application
    Is it possible to use this library in angular?
    Ashwin Indurti
    This worked perfectly with my apple pencil thanks so much
    Alexander Tambovsky
    I am hella hard
    Tyler Hall
    Anyone know of a package to use this in angular 8?
    During our test we have received values above 1.0. The user agent string is:
    "Mozilla/5.0 (Linux; Android 9; EML-L29 Build/HUAWEIEML-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.92 Mobile Safari/537.36"
    which would point to Huawei P20.
    Unfortunately I do not have more info, since this was only intercepted on our backend, without the access to the device.
    This is useful but when I use right click this notice that I am pressing but I wasn't.
    Ai Xin
    is the pressure possible to be used on react native?

    i needed this function to code out the pressure on screen when it is pressed on a android phone.

    im using react native cli (android).

    the pressure must be combined with a drawing canvas

    Qalqi Inc.
    Any possibility with react native ?