![](https://secure.gravatar.com/avatar/46b7fe9c91059c866acc6c82da614e1f.jpg?s=120&d=mm&r=g)
On Sat, 25 Aug 2007 18:10:58 +0100, Jon A. Cruz <jon@...18...> wrote:
On Aug 25, 2007, at 2:48 AM, Thomas Worthington wrote:
I have a patch in the system for this and I did have to put in a central "wrangling point", which is basically a very simple event snooper which sets the Alt flag if the <user selectable (defaults to 1) mod flag> is set. This user setting is a new option in the preferences.xml file so can be set differently by each user for their keyboard rather than being hardcoded in the way the current Alt usage is.
Thanks.
The main question, though, is how the different key modifiers work at different points on different platforms.
There's a very good chance it will work, given that all the existing code seems to have the test for GDK_MOD1_MASK hardcoded and the new code simply makes sure that flag is set before ANYTHING else gets to look at the event. That was the main reason I ended up going down that route, the other options were less scary initially, but much harder to maintain in the long run.
Checks probably should be done on Linux, Windows and OS X. Also I know that we might want to check remote X11 and VNC behavior. Those last three got in the way of certain things in the past, and hid some problems that would show on "normal" platforms.
The only one of these I can test is remote X11, which works as expected for me.
But, as I said, the code does nothing by default to how events are handled and unless the option "mapalt" is actually set and set to a value other than "1", the rest of the code "universe" should see exactly what it always has and the hardcoded tests for GDK_MOD1_MASK will work fine. So I'm confident (just as Napoleon was when he left for Moscow).
The only issue I foresee is someone who transfers their prefence file from platform to platform. However, the code is designed so that there is actually only one line that has to be removed to toally deactivate it:
gdk_event_handler_set ((GdkEventFunc)snooper, 0,&snoopunroll);
in sp_main_gui (main.cpp).
If the snooper is not set as the handler then it's never called and can't have any effect other than a little bit of code bloat. So perhaps a #ifdef X11 (assuming such a thing is available) around this would assuage any worries. I don't mean this to be a replacement for testing the code, of course, but perhaps we could at least restrict the code to the platform where it's an issue.
Thomas