Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Capture tablet pressure?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Pavey  
View profile  
 More options Oct 11 2009, 6:21 pm
From: Eric Pavey <warp...@gmail.com>
Date: Sun, 11 Oct 2009 15:21:20 -0700
Local: Sun, Oct 11 2009 6:21 pm
Subject: [pygame] Capture tablet pressure?

Been searching around, and haven't come up with anything:  Anyone know how
to capture tablet pressure in Pygame?  Pygame recognizes my tablet (Wacom
Bamboo) just fine as a mouse, buttonclicks etc, but no "pressure" based on
those clicks.  Any advice?  Is it possible that SDL doesn't support tablets?

thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Paige  
View profile  
 More options Oct 11 2009, 6:36 pm
From: James Paige <B...@HamsterRepublic.com>
Date: Sun, 11 Oct 2009 15:36:12 -0700
Local: Sun, Oct 11 2009 6:36 pm
Subject: Re: [pygame] Capture tablet pressure?

On Sun, Oct 11, 2009 at 03:21:20PM -0700, Eric Pavey wrote:
>    Been searching around, and haven't come up with anything:  Anyone know how
>    to capture tablet pressure in Pygame?  Pygame recognizes my tablet (Wacom
>    Bamboo) just fine as a mouse, buttonclicks etc, but no "pressure" based on
>    those clicks.  Any advice?  Is it possible that SDL doesn't support
>    tablets?

>    thanks

No, I'm pretty sure SDL does not have any pressure support. Although I
think that pressure sensitivity and multitouch may be planned for SDL
1.3/2.0, (maybe somebody can correct me if I am mistaken on that)

I remember hearing a rumor that pygtk supports pressure sensitivity, but
making pygame and pygtk work together might prove to be more trouble
than it is worth.

Also, some quick googling turns up pymt, which might be helpful, but I
haven't tried it myself.

---
James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jake b  
View profile  
 More options Oct 11 2009, 9:30 pm
From: Jake b <ninmonk...@gmail.com>
Date: Sun, 11 Oct 2009 20:30:15 -0500
Local: Sun, Oct 11 2009 9:30 pm
Subject: Re: [pygame] Capture tablet pressure?

maybe this?
http://stackoverflow.com/questions/45500/wacom-tablet-python-interface

I'm definitely interested if you get python+wacom pressure working.

Maybe you can read events yourself ( but would make it platform specific )?

--
Jake


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
machinimist@gmail.com  
View profile  
 More options Oct 11 2009, 9:45 pm
From: "machinim...@gmail.com" <machinim...@gmail.com>
Date: Mon, 12 Oct 2009 03:45:06 +0200
Local: Sun, Oct 11 2009 9:45 pm
Subject: Re: [pygame] Capture tablet pressure?

i think you could use cgkit. it includes a wintab wrapper if i remember
correctly.

On 10/12/09, Jake b <ninmonk...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Pavey  
View profile  
 More options Oct 12 2009, 1:00 pm
From: Eric Pavey <warp...@gmail.com>
Date: Mon, 12 Oct 2009 10:00:03 -0700
Local: Mon, Oct 12 2009 1:00 pm
Subject: Re: [pygame] Capture tablet pressure?

So I tried the cgkit\wintab route.  Had some success, but still can't get
the dang pressure.  Below is the code I came up with if anyone wants to poke
at it  When ran, it prints stuff like:

<Packet btns:1 x:10937 y:2140> 0 0

With the last two values representing pressure.  Well, it's a start ;)

# pressure.py
import os
import pygame
from cgkit import wintab

pygame.init()

hwnd = 1024
os.environ["SDL_WINDOWID"] = str(hwnd)

def main():
    screen = pygame.display.set_mode((640, 480))
    background = pygame.surface.Surface(screen.get_size())
    background.fill(pygame.color.Color("Black"))
    screen.blit(background, (0,0))

    #--------------------------------------------
    # Creates a "Context" object:
    tablet = wintab.Context()
    tablet.open(hwnd, True)

    looping = True
    while looping:
        events = pygame.event.get()
        for event in events:
            if event.type == pygame.QUIT:
                # allow for exit:
                looping = False

        #--------------------------------------------
        # Get a tuple of range of packets captured: (first, last)
        packetExtents = tablet.queuePacketsEx()
        if packetExtents[1] is not None:
            # This is a sub-list of Packet objects:
            packets = tablet.packetsGet(packetExtents[1])
            # Get the last Packet object:
            packet = packets[-1]
            # Print packet info, and pressure data:
            print packet, packet.normalpressure, packet.tangentpressure

        pygame.display.flip()
    pygame.quit()

if __name__ == "__main__":
    main()


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Pavey  
View profile  
 More options Oct 15 2009, 12:56 am
From: Eric Pavey <warp...@gmail.com>
Date: Wed, 14 Oct 2009 21:56:24 -0700
Local: Thurs, Oct 15 2009 12:56 am
Subject: Re: [pygame] Capture tablet pressure?

If anyone is interested, I got this working.  Posted on my blog\Pygame, with
pointers to source download:
http://www.akeric.com/blog/?p=777
http://www.pygame.org/project-Tablet+Pressure-1302-2287.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
René Dudfield  
View profile  
 More options Oct 15 2009, 1:39 am
From: René Dudfield <ren...@gmail.com>
Date: Thu, 15 Oct 2009 06:39:28 +0100
Local: Thurs, Oct 15 2009 1:39 am
Subject: Re: [pygame] Capture tablet pressure?

sweet :)  nice work.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »