Sorry about not responding until now... I think my mail server or client
is doing funny things to some of my mail.
(Also, the 2nd link you gave doesn't seem to work...)
Not having tried a Wacom tablet, I don't have a whole lot of advice. SDL and as a consequence pygame don't have direct support for a tablet, and the question has been asked on both lists relatively recently: http://www.libsdl.org/pipermail/sdl/2005-October/070927.html http://www.mail-archive.com/pygame-users@xxxxxxxx/msg00730.html
You should be able to use the tablet as a mouse however, as is suggested in the second link, by adding the current position to the vector components. It's likely you won't be able to easily use a tablet in visionegg, unless you write your own interface.
On Aug 30, 2006, at 7:23 PM, Neil Halelamien wrote:
Is there any way I can get input from a Wacom graphics tablet? Right now Vision Egg is treating the tablet as a drifting mouse (position on tablet becomes cursor velocity), rather than a tablet.
It seems that pygame doesn't have any explicit tablet input method, so if I wanted to implement tablet support myself, what options do I have? Is there anything I could do without having to edit pygame itself?
-- Neil Halelamien ====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html
#!/usr/bin/env python from VisionEgg import * start_default_logging(); watch_exceptions() from VisionEgg.Core import * from VisionEgg.FlowControl import Presentation, FunctionController from VisionEgg.Textures import * import pygame import Image, ImageDraw import Numeric import OpenGL.GL as gl screen = get_default_screen() image_size = screen.size image = Image.new("L",image_size,(0)) draw = ImageDraw.Draw(image) # create a TextureStimulus to allocate memory in OpenGL stimulus = TextureStimulus(mipmaps_enabled=0, texture=Texture(image), size=image_size, texture_min_filter=gl.GL_LINEAR, position=(screen.size/2.0,screen.size/2.0), anchor='center') cursor = FixationSpot() viewport = Viewport(screen=screen, stimuli=[stimulus, cursor]) (x,y) = pygame.mouse.get_pos() # hack to allow scope in put_image old_pos = [x,y] old_xy = old_pos # Use a controller to hook into go loop, but control texture buffer # through direct manipulation. texture_object = stimulus.parameters.texture.get_texture_object() fullscreen = screen.constant_parameters.fullscreen p = Presentation(go_duration=('forever',),viewports=[viewport]) #p = Presentation(go_duration=(10.0, 'seconds'),viewports=[viewport]) def keydown(event): if event.key == pygame.locals.K_ESCAPE: quit(event) def quit(event): print 'quit' p.parameters.go_duration = (0,'frames') p.parameters.handle_event_callbacks = [(pygame.locals.QUIT, quit), (pygame.locals.KEYDOWN, keydown)] def put_image(t): # can run into problems with fullscreen mode if long time since last mouse.get_rel() call, since doubles distance from center # using max-priority reduces problems (relx,rely) = pygame.mouse.get_rel() (x,y) = pygame.mouse.get_pos() posx = x posy = y pressed = pygame.mouse.get_pressed() if old_pos is 0 and old_pos is 0: old_pos = posx old_pos = posy return if relx is 0 and rely is 0: return if fullscreen: x = relx y = rely x = x + screen.size/2 y = y + screen.size/2 #if abs(old_xy - x) > rel_thresh or abs(old_xy - y) > rel_thresh: #return cursor.parameters.position = (x,screen.size-y) if pressed: draw.line(old_xy+[x,y],fill=(255)) texture_object.put_sub_image(image) old_pos = posx # can't do old_pos = (x,y), because ruins scope old_pos = posy old_xy = x old_xy = y p.add_controller(None,None,FunctionController(during_go_func=put_image)) p.go()