Cross platform key modifiers
Not sure what past history we inherited, but I am questioning the semantics of our key modifiers. My understanding is that the following is industry standard... OSX Windows Linux option alt alt cmd ctrl ctrl with Copy being the simplest example of this... cmd-c ctrl-c ctrl-c Supporting this view: * "option" and "alternative" are synonyms * "command" and "control" have similar meaning (e.g. in the army if you command someone, you control them) * Microsoft say so (https://support.microsoft.com/en-us/kb/970299) * Apple say so (https://support.apple.com/kb/PH18812?locale=en_US) and indeed marks its keyboards with "alt" and "option" on the same key ( http://www.apple.com/au/keyboard/) So examining this with KMLog setDebug.Transcript open. On OSX Pharo 50044 I get... option+arrowLeft --> [keystroke '<Opt-left>'] cmd+arrowLeft --> [keystroke '<Cmd-left>'] ctrl+arrowLeft --> OS changes screens but I am told that Windows gives... alt+arrowLeft --> [keystroke '<Cmd-left>'] ctrl+arrowLeft --> [keystroke '<Ctrl-left>'] when I believe Windows should be... alt+arrowLeft --> [keystroke '<Opt-left>'] ctrl+arrowLeft --> [keystroke '<Cmd-left>'] Part of the issue I think is that our keystroke mapping should be more abstract. When I was using Pharo on Windows, sometimes it felt like a second class citizen wrt key mappings, mapping ctrl-c to an apple-named <cmd-c>. Perhaps what we should see is: OSX... option+arrowLeft --> [keystroke '<Meta-left>'] cmd+arrowLeft --> [keystroke '<Hotkey-left>'] Windows... alt+arrowLeft --> [keystroke '<Meta-left>'] ctrl+arrowLeft --> [keystroke '<Hotkey-left>'] Otherwise there will always be the tension on windows that ctrl-c should generate [<keystroke '<Ctrl-c>] and we end up with definitions repetitively formed like... PharoShortcuts>>acceptShortcut ^ $s ctrl win | $s ctrl unix | $s command mac which opens the door for inconsistencies. We should only need to do something like... PharoShortcuts>>acceptShortcut ^ $s hotkey and leave it to the platform default or user preference the define what the hotkey actually is. A status line in the Keymap Browser could display which actual real keys map to <Hotkey> and <Meta>. What are you thoughts? cheers -ben
Hi ben, 2015-05-22 17:28 GMT+02:00 Ben Coman <btc@openinworld.com>:
Not sure what past history we inherited, but I am questioning the semantics of our key modifiers. My understanding is that the following is industry standard... OSX Windows Linux option alt alt cmd ctrl ctrl
Yes, this is what I expected too. And I thought this is for what KMCommandModifier is used for. With that, I would expect "Character arrowLeft command" maps to Ctrl+Left for windows/linux Meta+Left for Mac (If Meta is the Command-Key on a Mac keyboard).
with Copy being the simplest example of this... cmd-c ctrl-c ctrl-c
Supporting this view: * "option" and "alternative" are synonyms * "command" and "control" have similar meaning (e.g. in the army if you command someone, you control them) * Microsoft say so (https://support.microsoft.com/en-us/kb/970299) * Apple say so (https://support.apple.com/kb/PH18812?locale=en_US) and indeed marks its keyboards with "alt" and "option" on the same key ( http://www.apple.com/au/keyboard/)
So examining this with KMLog setDebug.Transcript open.
On OSX Pharo 50044 I get... option+arrowLeft --> [keystroke '<Opt-left>'] cmd+arrowLeft --> [keystroke '<Cmd-left>'] ctrl+arrowLeft --> OS changes screens
but I am told that Windows gives... alt+arrowLeft --> [keystroke '<Cmd-left>'] ctrl+arrowLeft --> [keystroke '<Ctrl-left>']
when I believe Windows should be... alt+arrowLeft --> [keystroke '<Opt-left>'] ctrl+arrowLeft --> [keystroke '<Cmd-left>']
Part of the issue I think is that our keystroke mapping should be more abstract.
When I was using Pharo on Windows, sometimes it felt like a second class citizen wrt key mappings, mapping ctrl-c to an apple-named <cmd-c>. Perhaps what we should see is:
OSX... option+arrowLeft --> [keystroke '<Meta-left>'] cmd+arrowLeft --> [keystroke '<Hotkey-left>']
Windows... alt+arrowLeft --> [keystroke '<Meta-left>'] ctrl+arrowLeft --> [keystroke '<Hotkey-left>']
Otherwise there will always be the tension on windows that ctrl-c should generate [<keystroke '<Ctrl-c>] and we end up with definitions repetitively formed like... PharoShortcuts>>acceptShortcut ^ $s ctrl win | $s ctrl unix | $s command mac
which opens the door for inconsistencies. We should only need to do something like... PharoShortcuts>>acceptShortcut ^ $s hotkey
Isn't OSXs Command-key like MS-Windows "Window" or Linux "Meta" -key?
and leave it to the platform default or user preference the define what the hotkey actually is. A status line in the Keymap Browser could display which actual real keys map to <Hotkey> and <Meta>.
What are you thoughts? cheers -ben
Great OP! We should get this straight for sure... Nicolai Hess wrote
Yes, this is what I expected too. ... With that, I would expect "Character arrowLeft command" maps to Ctrl+Left for windows/linux Meta+Left for Mac (If Meta is the Command-Key on a Mac keyboard).
That makes sense to me. "command" seems like it may be the best abstract term. Hotkey already has a meaning (http://en.wikipedia.org/wiki/Keyboard_shortcut), and it seems meta is used inconsistently by the platforms - i.e. Mac uses it for commands, but Windows uses ctrl instead. IIRC we already treat #option and #alt as synonyms... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Cross-platform-key-modifiers-tp4828113p4828461.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Camillo introduced a while ago the meta modifier: $a meta $z meta shift meta is sensitive to the current environment and is equivalent to what you where describing above: - command in mac - control in windows/unix What should be done is to use it in the system :). Guille El lun., 25 de may. de 2015 a la(s) 2:16 p. m., Sean P. DeNigris < sean@clipperadams.com> escribió:
Great OP! We should get this straight for sure...
Nicolai Hess wrote
Yes, this is what I expected too. ... With that, I would expect "Character arrowLeft command" maps to Ctrl+Left for windows/linux Meta+Left for Mac (If Meta is the Command-Key on a Mac keyboard).
That makes sense to me. "command" seems like it may be the best abstract term. Hotkey already has a meaning (http://en.wikipedia.org/wiki/Keyboard_shortcut), and it seems meta is used inconsistently by the platforms - i.e. Mac uses it for commands, but Windows uses ctrl instead. IIRC we already treat #option and #alt as synonyms...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Cross-platform-key-modifiers-tp4828113p4828461.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Yes meta key come from Lisp Machine: http://en.wikipedia.org/wiki/Meta_key I guess we should have a look how Emacs solve this keybinding issue regarding multiple platforms. On Wed, May 27, 2015 at 9:29 AM, Guillermo Polito <guillermopolito@gmail.com> wrote:
Camillo introduced a while ago the meta modifier:
$a meta
$z meta shift
meta is sensitive to the current environment and is equivalent to what you where describing above: - command in mac - control in windows/unix
What should be done is to use it in the system :).
Guille
El lun., 25 de may. de 2015 a la(s) 2:16 p. m., Sean P. DeNigris <sean@clipperadams.com> escribió:
Great OP! We should get this straight for sure...
Nicolai Hess wrote
Yes, this is what I expected too. ... With that, I would expect "Character arrowLeft command" maps to Ctrl+Left for windows/linux Meta+Left for Mac (If Meta is the Command-Key on a Mac keyboard).
That makes sense to me. "command" seems like it may be the best abstract term. Hotkey already has a meaning (http://en.wikipedia.org/wiki/Keyboard_shortcut), and it seems meta is used inconsistently by the platforms - i.e. Mac uses it for commands, but Windows uses ctrl instead. IIRC we already treat #option and #alt as synonyms...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Cross-platform-key-modifiers-tp4828113p4828461.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- Serge Stinckwich UCBN & UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
SergeStinckwich wrote
how Emacs solve this keybinding issue
For one thing, Emacs gives the underlying platform the finger and institutes the same set of unintelligible keybindings regardless of platform conventions ;) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Cross-platform-key-modifiers-tp4828113p4828893.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Serge Stinckwich <serge.stinckwich@gmail.com> writes:
I guess we should have a look how Emacs solve this keybinding issue regarding multiple platforms.
Emacs works really well in this regard and should be used as a reference. If you have any specific question, I can have a look. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
On Wed, May 27, 2015 at 3:56 PM, Damien Cassou <damien.cassou@inria.fr> wrote:
Serge Stinckwich <serge.stinckwich@gmail.com> writes:
I guess we should have a look how Emacs solve this keybinding issue regarding multiple platforms.
Emacs works really well in this regard and should be used as a reference. If you have any specific question, I can have a look.
:-) -- Serge Stinckwich UCBN & UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
I want cmd-k damien. and cmd-A and cmd-E :) Le 27/5/15 15:56, Damien Cassou a écrit :
Serge Stinckwich <serge.stinckwich@gmail.com> writes:
I guess we should have a look how Emacs solve this keybinding issue regarding multiple platforms. Emacs works really well in this regard and should be used as a reference. If you have any specific question, I can have a look.
2015-05-27 9:29 GMT+02:00 Guillermo Polito <guillermopolito@gmail.com>:
Camillo introduced a while ago the meta modifier:
$a meta
$z meta shift
meta is sensitive to the current environment and is equivalent to what you where describing above: - command in mac - control in windows/unix
What should be done is to use it in the system :).
Then there is something I don't understand or I don't do it right :) a shortcut defined like: $b meta shift never matches for me (on windows). But $b ctrl shift $b command shift works. (the last on matches on alt+shift+b, but defining a keyshortcut as $b alt shift again does not work).
Guille
El lun., 25 de may. de 2015 a la(s) 2:16 p. m., Sean P. DeNigris < sean@clipperadams.com> escribió:
Great OP! We should get this straight for sure...
Nicolai Hess wrote
Yes, this is what I expected too. ... With that, I would expect "Character arrowLeft command" maps to Ctrl+Left for windows/linux Meta+Left for Mac (If Meta is the Command-Key on a Mac keyboard).
That makes sense to me. "command" seems like it may be the best abstract term. Hotkey already has a meaning (http://en.wikipedia.org/wiki/Keyboard_shortcut), and it seems meta is used inconsistently by the platforms - i.e. Mac uses it for commands, but Windows uses ctrl instead. IIRC we already treat #option and #alt as synonyms...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Cross-platform-key-modifiers-tp4828113p4828461.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (7)
-
Ben Coman -
Damien Cassou -
Guillermo Polito -
Nicolai Hess -
Sean P. DeNigris -
Serge Stinckwich -
stepharo