Alt and Mode_switch for shortcuts

Hi everyone,
On Mac OS X Leopard, the option/alt key is mapped to Mode_switch by default under X11 and this apparently cause it to no longer work as "alt" in Inkscape (the behavior is supposed to be consistent with the previous OS version though I never saw any problem with Alt before. anyway, they changed a lot of stuff on X11 side, not always for the better...). Modifying the ~/.Xmodmap [1] works for me but since Alt is so important in Inkscape I would prefer fixing it upstream rather than asking everyone to modify their ~/.Xmodmap.So my questions are: - what is the difference in essence between Alt and Mode_switch? Mode_switch in particular seems to be used rather inconsistently between the OSes, keyboards etc. - Would there be a problem in using Mode_switch or Alt conversely for all alt based shortcuts in Inkscape? Is it already the case in some places? - What about the Alt remapping hack. I could find a patch o the mailing list but nothing after that. I think it was applied though so how could I use it?
Thanks in advance for your help.
[1] ! This one switches both alt keys to be alt: keycode 66 = Alt_L keycode 69 = Alt_R clear mod1 add mod1 = Alt_L Alt_R
JiHO --- http://jo.irisson.free.fr/

On Dec 14, 2007, at 7:54 PM, jiho wrote:
- what is the difference in essence between Alt and Mode_switch?
Mode_switch in particular seems to be used rather inconsistently between the OSes, keyboards etc.
- Would there be a problem in using Mode_switch or Alt conversely for
all alt based shortcuts in Inkscape? Is it already the case in some places?
I'm not sure, since I have no "mode_switch" key on my setups.
I don't seem to have an AltGR key either.
I'll have to dig some stuff up. Recently I did a quick hack on some test code to make it show key combos. I saw a few keys, including meta and some mod friends, but no hyper nor super.
Once it's going, I'm now very convinced that we need to collect such info in some tables on the wiki. Things like language/local, laptop or desktop, OS, etc. will help is narrow down these key issues.

On Sat, 15 Dec 2007 03:54:12 -0000, jiho <jo.irisson@...400...> wrote:
- What about the Alt remapping hack. I could find a patch o the
mailing list but nothing after that. I think it was applied though so how could I use it?
It's in SVN so you might me able to use it. There is documentation on the Wiki but in essence if you know which modifier flags are being set by your keyboard you can tell Inkscape to treat the one you want as the Alt key. If you have xkeycaps then that information is listed with the keys. Once you know what you want to set it to the option is set (by hand) in the preference file under:
<Group="options"> <group id="mapalt" vlaue="x">
where x is the value you want and can range from 1 to 5
Thomas

On 2007-December-15 , at 17:20 , Thomas Worthington wrote:
On Sat, 15 Dec 2007 03:54:12 -0000, jiho <jo.irisson@...400...> wrote:
- What about the Alt remapping hack. I could find a patch o the
mailing list but nothing after that. I think it was applied though so how could I use it?
It's in SVN so you might me able to use it. There is documentation on the Wiki but in essence if you know which modifier flags are being set by your keyboard you can tell Inkscape to treat the one you want as the Alt key. If you have xkeycaps then that information is listed with the keys. Once you know what you want to set it to the option is set (by hand) in the preference file under:
<Group="options">
<group id="mapalt" vlaue="x">
where x is the value you want and can range from 1 to 5
Sorry I can't find it on the wiki. Would you mind pointing the page please? I don't have xkeycaps but $ xmodmap -pm xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44) lock Caps_Lock (0x41) control Control_L (0x43), Control_R (0x46) mod1 Mode_switch (0x42), Mode_switch (0x45) mod2 Meta_L (0x3f), Meta_R (0x47) mod3 mod4 mod5
So apparently I should remap mod number 1 to Alt:
<group id="options"> <group id="mapalt" value="1">
However this is what was already in my preferences.xml and Alt still has no effect. Any idea why?
Thanks for your help.
PS: my current setup, with an ~.Xmodmap and which works is: And with my current setup: $ xmodmap -pm xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44) lock Caps_Lock (0x41) control Control_L (0x43), Control_R (0x46) mod1 Alt_L (0x42), Alt_R (0x45) mod2 Meta_L (0x3f), Meta_R (0x47) mod3 mod4 mod5
JiHO --- http://jo.irisson.free.fr/

Sorry for the delay; Christmas and trying to move house do not mix well.
There is documentation for changing the mod key that Inkscape treats as "Alt" on the 0.46 under "Using other keys in place of Alt" and in the FAQ under "How to make Alt+click and Alt+drag work on Linux?"
The defualt value, which used to be hardcoded, is 1 and that should equate to Alt on most systems. In your example I would expect that setting mapalt to 2 to allow pressing the meta keys to activate anything which is documented as using the Alt key.
For example, on my Linux machine I'm using an IBM model-M keyboard with AltGr, which I've set to map to Meta_R and mod3, so I set mapalt in my preferences file to 3. Now I can hold down AltGr and have Inkscape treat it as the Alt key (which I can't use as my window manager uses it for various functions).
I assume that your keyboard doesn't have any keys actually labeled "Meta", so a first step would be to find out which key(s) are being treated as Meta and work from there.
The object of the mapalt code is not to get Alt working but to let something else act as Alt if you can't use Alt in an app shortcut, which many Linux users can't
Does that help?
Thomas
On Sun, 16 Dec 2007 23:55:52 -0000, jiho <jo.irisson@...400...> wrote:
On 2007-December-15 , at 17:20 , Thomas Worthington wrote:
On Sat, 15 Dec 2007 03:54:12 -0000, jiho <jo.irisson@...400...> wrote:
- What about the Alt remapping hack. I could find a patch o the
mailing list but nothing after that. I think it was applied though so how could I use it?
It's in SVN so you might me able to use it. There is documentation on the Wiki but in essence if you know which modifier flags are being set by your keyboard you can tell Inkscape to treat the one you want as the Alt key. If you have xkeycaps then that information is listed with the keys. Once you know what you want to set it to the option is set (by hand) in the preference file under:
<Group="options">
<group id="mapalt" vlaue="x">
where x is the value you want and can range from 1 to 5
Sorry I can't find it on the wiki. Would you mind pointing the page please? I don't have xkeycaps but $ xmodmap -pm xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44) lock Caps_Lock (0x41) control Control_L (0x43), Control_R (0x46) mod1 Mode_switch (0x42), Mode_switch (0x45) mod2 Meta_L (0x3f), Meta_R (0x47) mod3 mod4 mod5
So apparently I should remap mod number 1 to Alt:
<group id="options"> <group id="mapalt" value="1">
However this is what was already in my preferences.xml and Alt still has no effect. Any idea why?
Thanks for your help.
PS: my current setup, with an ~.Xmodmap and which works is: And with my current setup: $ xmodmap -pm xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44) lock Caps_Lock (0x41) control Control_L (0x43), Control_R (0x46) mod1 Alt_L (0x42), Alt_R (0x45) mod2 Meta_L (0x3f), Meta_R (0x47) mod3 mod4 mod5
JiHO
participants (3)
-
jiho
-
Jon A. Cruz
-
Thomas Worthington