Hello
I have never used OSX, but I know there are issues with modifier keys on it. Correct me if I'm wrong. * Control is called Command, and is used for shortcuts * There is a different key called Control, which is used to emulate a right click and is rarely used for shortcuts * Left Alt is called Option and is used for shortcuts * Right Alt (AltGr) is called Alt and is used for inputting diacritics (third level chooser) * Shift is called Shift
I would like to know the following things, to create an initial solution for Inkscape, with the goal of including it in GTK. - How are those keys reported to GDK, e.g. which bits in the state field are set when they are pressed? GDK knows about Shift, Control, Mod1 (aka Alt), Super (aka Windows key), Hyper and Meta. Which of them correspond to which Mac keys? - Does the above differ in the Quartz version of GTK? I know there are some X server preferences that can be used to alter the mapping. - Is it OK to shorten "Option" as "Opt" in the UI? I know that Command is shortened as Cmd.
My plan is as follows: - Define some constants in ui/tool/event-utils.h that define cross-platform masks for the "state" field of GDK events, so that e.g. INK_STATE_ALT maps to Alt on Linux / Windows and to Option on Macs, and INK_STATE_CONTROL accordingly maps to Control or Command. - Define macros for names of the keys indicated by the above masks. For example INK_KEYNAME_CTRL would expand to "Ctrl" or "Cmd". This name would also be marked for translation. - Adjust all messages that contain modifier names. - Look into modifying GTK so that menu items created from actions have the correct modifier names. Alternatively, derive from Gtk::Action and override the widget creation functions.
PS is there any way to run OSX in a virtual machine? If not, then maybe people who do have access to OSX machines could help.
Regards, Krzysztof
Sorry for top-posting... I think you could kill 2 birds with 1 stone by implementing a keyboard shortcut modification dialog (like a lot of apps have). That way people can easily choose pre-set layouts (more user friendly than moving xml files around), easily customize their own stuff, and on OSX we could have it default to an OSX one (and people could then change it if they don't like it).
Cheers, Josh
On Fri, 2010-03-12 at 02:35 +0100, Krzysztof Kosiński wrote:
Hello
I have never used OSX, but I know there are issues with modifier keys on it. Correct me if I'm wrong.
- Control is called Command, and is used for shortcuts
- There is a different key called Control, which is used to emulate a
right click and is rarely used for shortcuts
- Left Alt is called Option and is used for shortcuts
- Right Alt (AltGr) is called Alt and is used for inputting diacritics
(third level chooser)
- Shift is called Shift
I would like to know the following things, to create an initial solution for Inkscape, with the goal of including it in GTK.
- How are those keys reported to GDK, e.g. which bits in the state
field are set when they are pressed? GDK knows about Shift, Control, Mod1 (aka Alt), Super (aka Windows key), Hyper and Meta. Which of them correspond to which Mac keys?
- Does the above differ in the Quartz version of GTK? I know there are
some X server preferences that can be used to alter the mapping.
- Is it OK to shorten "Option" as "Opt" in the UI? I know that Command
is shortened as Cmd.
My plan is as follows:
- Define some constants in ui/tool/event-utils.h that define
cross-platform masks for the "state" field of GDK events, so that e.g. INK_STATE_ALT maps to Alt on Linux / Windows and to Option on Macs, and INK_STATE_CONTROL accordingly maps to Control or Command.
- Define macros for names of the keys indicated by the above masks.
For example INK_KEYNAME_CTRL would expand to "Ctrl" or "Cmd". This name would also be marked for translation.
- Adjust all messages that contain modifier names.
- Look into modifying GTK so that menu items created from actions have
the correct modifier names. Alternatively, derive from Gtk::Action and override the widget creation functions.
PS is there any way to run OSX in a virtual machine? If not, then maybe people who do have access to OSX machines could help.
Regards, Krzysztof
Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mar 11, 2010, at 5:35 PM, Krzysztof Kosiński wrote:
Hello
I have never used OSX, but I know there are issues with modifier keys on it. Correct me if I'm wrong.
- Control is called Command, and is used for shortcuts
No.
Control is called "Ctl" and exists separately.
Command is used for shortcuts. I believe that Command usually maps to the Super key. Or might be Meta. I'd have to check.
- There is a different key called Control, which is used to emulate a
right click and is rarely used for shortcuts
Control is the *same* control key as on Linux, and maps as such.
But yes, control-click is to invoke a "right click" context menu.
- Left Alt is called Option and is used for shortcuts
Yes left alt is also called Option.
No, for the US layout alt is not used for shortcuts. It's often used for other characters.
- Right Alt (AltGr) is called Alt and is used for inputting diacritics
(third level chooser)
Right alt is not AltGr in a US Layout. It is simply right-alt and generally functions as the left alt.
Not all Mac keyboards have this. Noticeably most laptops have it missing.
- Shift is called Shift
The left and right shift keys are left and right shift.
I would like to know the following things, to create an initial solution for Inkscape, with the goal of including it in GTK.
- How are those keys reported to GDK, e.g. which bits in the state
field are set when they are pressed? GDK knows about Shift, Control, Mod1 (aka Alt), Super (aka Windows key), Hyper and Meta. Which of them correspond to which Mac keys?
I think Meta is often the Command/Apple/Flower key. Left alt and right alt are reported separately, and left and right shift are identifiable.
- Does the above differ in the Quartz version of GTK? I know there are
some X server preferences that can be used to alter the mapping.
Meta-w is copy in emacs. In OSX it is "close the window". For my X I do have the option set to pass those through instead of letting the OS close my editing windows.
- Is it OK to shorten "Option" as "Opt" in the UI? I know that Command
is shortened as Cmd.
It's generally shorted to "⌥" which is U+2325 http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=2325
My plan is as follows:
[SNIP of masks, macros and defines]
I've been working on this also.
One of the things we need to support is input devices. A common need is for tablets, joysticks, etc. to be able to work as modifiers. Another very common request is user assigned as Josh mentioned.
With all considerations taken in, it seems best to plan for a dynamic approach where one uses functions instead of hardcoded masks and macros. This will allow for things like per-user customizations and also hooking in support for extended input devices.
BTW, we are very unique on the input front. It's pretty much down to just us and GIMP for using extended devices on GTK, and they are even removing the stock dialog from GTK so that apps will no longer have a means to enable other than mouse emulation. Our app is giving users detailed control beyond the normal GTK app in other areas. So that is consistent with more detailed control on the keyboard front.
PS is there any way to run OSX in a virtual machine? If not, then maybe people who do have access to OSX machines could help.
Unfortunately last I looked it seemed difficult to do this. Most likely illegal unless one purchases a copy of OS X.
On Mar 11, 2010, at 7:54 PM, Jon Cruz wrote:
- Left Alt is called Option and is used for shortcuts
Yes left alt is also called Option.
No, for the US layout alt is not used for shortcuts. It's often used for other characters.
Well, to clarify a bit the alt key is not usually used for shortcuts by itself. It is often a *modifier* for shortcuts just like shift, control, fn and caps lock are.
For more details you can see this Apple support article http://support.apple.com/kb/HT1343
On Thu, 2010-03-11 at 19:54 -0800, Jon Cruz wrote:
On Mar 11, 2010, at 5:35 PM, Krzysztof Kosiński wrote:
PS is there any way to run OSX in a virtual machine? If not, then maybe people who do have access to OSX machines could help.
Unfortunately last I looked it seemed difficult to do this. Most likely illegal unless one purchases a copy of OS X.
There's another legality issue. The License Agreement for OSX stipulates it can only be run on official Apple hardware.
From http://store.apple.com/Catalog/US/Images/MacOSX.htm section on
permitted uses:
"A. This License allows you to install and use one copy of the Apple Software on a single Apple-labeled computer at a time."
Cheers, Josh
W dniu 12 marca 2010 04:54 użytkownik Jon Cruz <jon@...18...> napisał:
One of the things we need to support is input devices. A common need is for tablets, joysticks, etc. to be able to work as modifiers. Another very common request is user assigned as Josh mentioned.
With all considerations taken in, it seems best to plan for a dynamic approach where one uses functions instead of hardcoded masks and macros. This will allow for things like per-user customizations and also hooking in support for extended input devices.
I agree, a dynamic approach is better and will benefit other people besides Mac users (though it requires rewriting more code :) )
W dniu 12 marca 2010 05:38 użytkownik ~suv <suv-sf@...58...> napisał:
AFAIU X11-based applications running under X11/Xquartz get the key press events from X11, not from OS X itself. This means that remapping and swapping of keysyms can and currently is recommended to be done with xmodmap and not per application (see Inkscape FAQ). It also means whatever default keysyms are seen by GDK and applications like GIMP or Inkscape can change with new X11 releases (AFAIK this happened with the 'Option' key which was mapped to 'Alt_L' in earlier X11 versions and currently defaults to 'Mode_switch' for both right and left option/alt key).
The thing I'm concerned about is that even when you change the mapping in .Xmodmap, the modifier names in the UI stay the same. That's ugly. I think the names should be settable from some data file, so that we can ship different versions of this file for different systems, and get the correct modifier names on OSX.
Regards, Krzysztof
On 12/3/10 02:35, Krzysztof Kosiński wrote:
I have never used OSX, but I know there are issues with modifier keys on it. Correct me if I'm wrong.
- Control is called Command, and is used for shortcuts
Command (labeled 'cmd') exists and is used for shortcuts
- There is a different key called Control, which is used to emulate a
right click and is rarely used for shortcuts
Control (labeled 'ctrl') exists, it can be used (and is used by default settings) for shortcuts (shortcuts are user definable per System Preferences)
- Left Alt is called Option and is used for shortcuts
- Right Alt (AltGr) is called Alt and is used for inputting diacritics
(third level chooser)
Both Alt keys (left and - if available, depending on keyboard model - right) are labeled ⌥/alt and both can be used for shortcuts as well as to input special characters. AFAIK OS X does not differentiate between Alt_L and Alt_R
- Shift is called Shift
Yes
I would like to know the following things, to create an initial solution for Inkscape, with the goal of including it in GTK.
- How are those keys reported to GDK, e.g. which bits in the state
field are set when they are pressed? GDK knows about Shift, Control, Mod1 (aka Alt), Super (aka Windows key), Hyper and Meta. Which of them correspond to which Mac keys?
AFAIU X11-based applications running under X11/Xquartz get the key press events from X11, not from OS X itself. This means that remapping and swapping of keysyms can and currently is recommended to be done with xmodmap and not per application (see Inkscape FAQ). It also means whatever default keysyms are seen by GDK and applications like GIMP or Inkscape can change with new X11 releases (AFAIK this happened with the 'Option' key which was mapped to 'Alt_L' in earlier X11 versions and currently defaults to 'Mode_switch' for both right and left option/alt key).
- Does the above differ in the Quartz version of GTK? I know there are
some X server preferences that can be used to alter the mapping.
X11: See attached screenshot for available X server input preferences.
Quartz: I guess it differs because there's no intermediary X11 between OS X and GTK+ but I have no knowledge about implementation and differences between the GTK+/X11 and GTK+/Quartz modules.
There are GTK+/Quartz bug reports about shortcuts (see some listed in Inkscape bug #438603) but I don't know if there are plans to change defaults in the GTK+/Quartz module (e.g. swapping Ctrl/Cmd)
- Is it OK to shorten "Option" as "Opt" in the UI? I know that Command
is shortened as Cmd.
Idk
My plan is as follows:
- Define some constants in ui/tool/event-utils.h that define
cross-platform masks for the "state" field of GDK events, so that e.g. INK_STATE_ALT maps to Alt on Linux / Windows and to Option on Macs, and INK_STATE_CONTROL accordingly maps to Control or Command.
- Define macros for names of the keys indicated by the above masks.
For example INK_KEYNAME_CTRL would expand to "Ctrl" or "Cmd". This name would also be marked for translation.
- Adjust all messages that contain modifier names.
- Look into modifying GTK so that menu items created from actions have
the correct modifier names. Alternatively, derive from Gtk::Action and override the widget creation functions.
I am not sure about swapping Ctrl/Cmd on application level. At the moment the same default shortcuts can be used in all X11 based applications (e.g. 'Ctrl-C/Ctrl-V' copies/pastes in Inkscape as well as in GIMP). If the user wants to change this with xmodmap this will affect all applications under X11 and avoid even more confusion (Cmd-C in Inkscape, but Ctrl-C in GIMP for the same basic operation?).
But for me Ctrl/Cmd is not the main issue on osx - getting the 'Alt' modifier right (e.g. when used in hard-coded keyboard shortcuts) seems far more critical because with default settings users on osx miss basic functionality in Inkscape (e.g. no 'select-under' with 'Alt-click', no line/letter spacing, no rotate ...), besides failing keyboard shortcuts (like 'Paste in Place' with 'Alt+Ctrl+V', clones with 'Alt+D'...) which however could be remapped in keys/default.xml.
PS is there any way to run OSX in a virtual machine? If not, then maybe people who do have access to OSX machines could help.
I think you need physical access to a mac with a default apple keyboard attached to work on this.
~suv
participants (4)
-
Jon Cruz
-
Joshua A. Andler
-
Krzysztof Kosiński
-
~suv