[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: [PCB PATCH] Teaching GTK hid to use mouse resources



Looks fantastic,  some comments.


need to look at gtk code for mod1, and OSX.....
see patch 1 from http://archives.seul.org/geda/user/May-2009/msg00457.html
option (alt) returns 1<<13, not GDK_MOD1_MASK

Might want to define a list of modifier masks, and allow for  
translation in the HIDs
You have it now no translation needed,  except that under GTK and OSX,  
the option(alt) key needs translation.

Could use strstr and tolower for parse modifiers to be more robust.

I have a 10 button mouse.......
+#define MAX_MOUSE_BUTTON 5
But laptop trackpads are normally 7, to include left and right scroll.

otherwise looks good.

Steve


On Jun 1, 2009, at 8:05 PM, Jared Casper wrote:

> PCB said:
>> ghid_load_menus():  Mouse resources are currently ignored by the  
>> GTK HID.
>> Please feel free to submit a patch to implement this!
>
> I had some free time over the weekend and have been wanting to get my
> hands dirty in the PCB code so I took a crack at this and wanted to
> get some feedback.
>
> Attached is a patch with a detailed commit message of what I did, but
> the general idea was to move the lesstif hid's handling of the mouse
> resources into a common hid file (which I called hid_resource) and
> have the gtk hid use that instead of being hardcoded.  This way the
> hid's are only responsible for catching the button press, determining
> which modifier keys were active, then calling the common code to
> handle it.  The common code does what the lesstif hid does, calls the
> actions defined in the resource file.  In theory more common stuff
> could be moved to hid_resource, the code to find and load the resource
> file, for example, is nearly identical in both hids.
>
> I changed up the Mouse resource in gpcb-menu.res to match the
> hardcoded behavior of the gtk hid as closely as possible (see the
> commit message for details).
>
> I've played around with it a bit and it seems to be working, but as
> this my first time meddling with the code, I'm sure I missed some
> stuff.  If anybody has time to look it over and/or try it out that
> would be great.  Comments regarding the approach, formatting, style,
> etc. are all appreciated (I did my best to match the style of the
> surrounding code).
>
> Jared
> <0001-Teaching-GTK-hid-to-use-mouse-resources.patch>
>
> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user