MacOSX USB tablet support

John M McIntosh johnmci at smalltalkconsulting.com
Sun Apr 11 08:12:05 UTC 2004


Javier Diaz=Reinoso had sent me this note a month (or two) back  
regarding support the USB tablets in the VM. He supplied some changes  
to the VM source and the EventSensor logic.  I'm wondering if there is  
broader interest? Mostly since I was in messing with sqMacUIEvents.c  
all day yesterday and maybe we should integrate his changes.

I'll note most of this is support by carbon events found starting here:
http://developer.apple.com/documentation/Carbon/Reference/ 
Carbon_Event_Manager_Ref/CarbonEventsRef/enum_group_10.html


> Hello!, I have now a working VM with the USB tablet support working, I  
> follow your advice and add a EventTypeTablet to the VM and the squeak  
> image, the changes are very small and the tablet examples work very  
> well.
>
> That is the good news, the bad news is that squeak UI now are very  
> slow, sending the new event alone cause this slowdown, I see you have  
> a ignoreLastEvent() optimization in the mouse events, I tested the VM  
> commenting this routine, this cause squeak to burn CPU but the UI  
> response to the clicks are fast, in the case of the tablet the  
> response to a click are very slow (about 2 secs. in a dual 1.8Ghz G5)  
> and also use more CPU, I am sending my changes so you can review if  
> something is missing, specially I don't know if in the squeak image  
> part some code is needed to process the new events faster.
>
> By the way I am using the NoEventSensorProcess-ar.3.cs with a  
> Squeak3.6-5424 image, the VM sources I download from CVS about 2 weeks  
> ago.
>
> Regards.
>
> Javier Diaz-Reinoso
> Web: http://homepage.mac.com/javier_diaz_r/

PS the event which is created in C is:

		evt->type = EventTypeTablet;
		evt->timeStamp = ioMSecs() & 536870911;
		/* pack data to fit in 24 bytes*/
		evt->unused1 = tabletData->absX;
		evt->unused2 = tabletData->absY;
		evt->unused3 = tabletData->absZ;
		evt->unused4 = (tabletData->buttons << 16) | (tabletData->pressure);
		evt->unused5 = (tabletData->tiltX << 16) | (tabletData->tiltY);
		evt->unused6 = (tabletData->rotation << 16) |  
(tabletData->tangentialPressure);

See
http://developer.apple.com/documentation/Carbon/Reference/ 
Carbon_Event_Manager_Ref/CarbonEventsRef/data_type_31.html

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list