Re: [cgkit-user] Cursor mask for two tablets simultaneously?
Brought to you by:
mbaas
|
From: Matthias B. <mat...@gm...> - 2014-06-03 20:29:21
|
Hi Ryan, I have never worked with two tablets at the same time, so I'm not sure what the correct way of doing this is. But if you already have two separate contexts that each is connected to a different device, isn't that enough to differentiate the events? Why would you still need the movemask? (I'm actually not sure if the movemask is used to distinguish between devices) I'm afraid if you need more details about the individual fields of the context or packet object you'll have to check the actual wintab documentation (see section 7.3, for example): http://www.wacomeng.com/windows/docs/Wintab_v140.htm Cheers, Matthias On 03.06.14 01:14, Ryan Morehead wrote: > I'm trying to use two Intuos 5 tablets (simultaneous input from each) to > move two cursors at once in pygame. > > I thought that I would be able to do this by initializing two separate > contexts and using the context.movemask to specify which cursors could > create move events for each. > > I haven't been able to get movemask to work in the way I thought it > would. Specifically, the first tablet's stylus is identified as cursor 2 > using the info commands, and the second tablet's cursor is 7. > > I'm not exactly clear on how to use the cursor mask command, but when I > set it to movemask = 2, it doesn't have any effect. > > I am, however, able to specify which device can create movement events > in the context. > > It occurs to me that the way I'm trying to do this is entirely > incorrect, but either way I could use some help. > > Below is the code for each context. > > class Tablet1(object): > def __init__(self, screen, hwnd=None): > self.hwnd = pygame.display.get_wm_info()["window"] > self.context = wintab.Context() > self.context.pktdata = (PK_X | PK_Y | PK_CURSOR) > self.context.movemask = 2 > self.context.device = 0 > self.context.open(self.hwnd, True) > > class Tablet2(object): > def __init__(self, screen, hwnd=None): > self.hwnd = pygame.display.get_wm_info()["window"] > self.context = wintab.Context() > self.context.pktdata = (PK_X | PK_Y | PK_CURSOR) > self.context.device = 1 > self.context.movemask = 7 > self.context.open(self.hwnd, True) > > Thanks, > > Ryan |