Hi guillermo I thought that we decided to change and not use on: do: for shortCuts (I'm happy that we change because for me it took me a while to understand that the key was not an exception. Could we deprecate on:do: on KMDispatcher? What is the replacement? onKey: do: initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts" self shortCuts keysAndValuesDo: [ :key :value | list on: key do: value ] => initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts" self shortCuts keysAndValuesDo: [ :key :value | list onHold: key do: value ] Stef
On 18 June 2013 15:59, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi guillermo
I thought that we decided to change and not use on: do: for shortCuts (I'm happy that we change because for me it took me a while to understand that the key was not an exception.
Could we deprecate on:do: on KMDispatcher? What is the replacement?
onKey: do:
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list on: key do: value ]
=>
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list onHold: key do: value ]
hold or press? you *press* the key, *hold* it for a while and then *release*. usually you receive 2 events - press and release. and you don't receive 'hold' event, since it is assumed that key is being held until it released. then on top of that, there is a key repeat functionality, is when user holds key it starts repeating (but again, ideally you don't receive a 'press' event, but you receive a synthetic 'keyChar' event)
Stef
-- Best regards, Igor Stasenko.
Additionally, this is processing on a shortcut, that is possibly on a sequence of keys... So, onKey:do: isn't very good. The replacement of asShortcut by asKeyCombination in 3.0 wasn't too good, either. But, to be coherent, it should certainly be: onKeyCombination:do: Thierry Le 18/06/2013 16:44, Igor Stasenko a écrit :
On 18 June 2013 15:59, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi guillermo
I thought that we decided to change and not use on: do: for shortCuts (I'm happy that we change because for me it took me a while to understand that the key was not an exception.
Could we deprecate on:do: on KMDispatcher? What is the replacement?
onKey: do:
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list on: key do: value ]
=>
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list onHold: key do: value ]
hold or press?
you *press* the key, *hold* it for a while and then *release*.
usually you receive 2 events - press and release. and you don't receive 'hold' event, since it is assumed that key is being held until it released.
then on top of that, there is a key repeat functionality, is when user holds key it starts repeating (but again, ideally you don't receive a 'press' event, but you receive a synthetic 'keyChar' event)
Stef
-- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
On Javascript, there are : - onkeypress - onkeydown - onkeyup I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me. Why not onKeyPress:do: ? 2013/6/18 Goubier Thierry <thierry.goubier@cea.fr>
Additionally, this is processing on a shortcut, that is possibly on a sequence of keys...
So, onKey:do: isn't very good.
The replacement of asShortcut by asKeyCombination in 3.0 wasn't too good, either.
But, to be coherent, it should certainly be:
onKeyCombination:do:
Thierry
Le 18/06/2013 16:44, Igor Stasenko a écrit :
On 18 June 2013 15:59, Stéphane Ducasse <stephane.ducasse@inria.fr>
wrote:
Hi guillermo
I thought that we decided to change and not use on: do: for shortCuts (I'm happy that we change because for me it took me a while to understand that the key was not an exception.
Could we deprecate on:do: on KMDispatcher? What is the replacement?
onKey: do:
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list on: key do: value ]
=>
initializeShortcuts "initialize the inspector' shortcuts with the dictionary defined in self shortCuts"
self shortCuts keysAndValuesDo: [ :key :value | list onHold: key do: value ]
hold or press?
you *press* the key, *hold* it for a while and then *release*.
usually you receive 2 events - press and release. and you don't receive 'hold' event, since it is assumed that key is being held until it released.
then on top of that, there is a key repeat functionality, is when user holds key it starts repeating (but again, ideally you don't receive a 'press' event, but you receive a synthetic 'keyChar' event)
Stef
-- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
-- Clément Béra Mate Virtual Machine Engineer Bâtiment B 40, avenue Halley 59650 *Villeneuve d'Ascq*
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about. A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it. Hence the onKeyCombination:do: (but I prefer onShortcut:do:) Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Esteban A. Maringolo [emaringolo@gmail.com] Date d'envoi : mardi 18 juin 2013 18:14 à : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts? 2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about.
A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it.
Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me. Stef
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Esteban A. Maringolo [emaringolo@gmail.com] Date d'envoi : mardi 18 juin 2013 18:14 Ã : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts?
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
I prefer the onKeyCombination* because of the following rationale: - to me a shortcut is the association between a key combination and an action - a key combination is a combination of keys :), which is associated with an action Stef, so far I changed the asShortcut => asKeyCombination, following the same idea :). Guille On Tue, Jun 18, 2013 at 8:25 PM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about.
A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it.
Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me.
Stef
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de
Esteban A. Maringolo [emaringolo@gmail.com]
Date d'envoi : mardi 18 juin 2013 18:14 Ã : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts?
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
excellent so how do we integrate this change? I will chnage the chapter on keymapping :) On Jun 18, 2013, at 9:57 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
I prefer the onKeyCombination* because of the following rationale:
- to me a shortcut is the association between a key combination and an action - a key combination is a combination of keys :), which is associated with an action
Stef, so far I changed the asShortcut => asKeyCombination, following the same idea :).
Guille
On Tue, Jun 18, 2013 at 8:25 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about.
A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it.
Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me.
Stef
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Esteban A. Maringolo [emaringolo@gmail.com] Date d'envoi : mardi 18 juin 2013 18:14 Ã : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts?
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
Why not something like bindKeyCombination:toAction: ? Ben On Jun 19, 2013, at 9:28 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
excellent so how do we integrate this change?
I will chnage the chapter on keymapping :)
On Jun 18, 2013, at 9:57 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
I prefer the onKeyCombination* because of the following rationale:
- to me a shortcut is the association between a key combination and an action - a key combination is a combination of keys :), which is associated with an action
Stef, so far I changed the asShortcut => asKeyCombination, following the same idea :).
Guille
On Tue, Jun 18, 2013 at 8:25 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about.
A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it.
Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me.
Stef
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Esteban A. Maringolo [emaringolo@gmail.com] Date d'envoi : mardi 18 juin 2013 18:14 Ã : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts?
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
Hello. Keymappings is very nice approach to subscribe on concrete system state instread of working with primitive event instances. And it can be generalized to support other events (not only key combinations). In this case subscribing API should not be related to key combinations 2013/6/19 Benjamin <benjamin.vanryseghem.pharo@gmail.com>
Why not something like
bindKeyCombination:toAction:
?
Ben
On Jun 19, 2013, at 9:28 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
excellent so how do we integrate this change?
I will chnage the chapter on keymapping :)
On Jun 18, 2013, at 9:57 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
I prefer the onKeyCombination* because of the following rationale:
- to me a shortcut is the association between a key combination and an action - a key combination is a combination of keys :), which is associated with an action
Stef, so far I changed the asShortcut => asKeyCombination, following the same idea :).
Guille
On Tue, Jun 18, 2013 at 8:25 PM, Stéphane Ducasse < stephane.ducasse@inria.fr> wrote:
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about.
A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it.
Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me.
Stef
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de
Esteban A. Maringolo [emaringolo@gmail.com]
Date d'envoi : mardi 18 juin 2013 18:14 Ã : Pharo Development List Objet : Re: [Pharo-dev] on:do: for shortcuts?
2013/6/18 Clément Bera <bera.clement@gmail.com>
On Javascript, there are :
onkeypress onkeydown onkeyup
I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me.
Why not onKeyPress:do: ?
+1 to each of the last two statements.
Wouldn't that be a bit too much for what is called *Key*mapping in the first place ? I don't know if you've tried to debug the internals of the Keymapping machine... But, when I did so, I found them complex enough not to try to get them to do more than keymapping :) In particular, the double going down the Morph tree to try on the Morph which has the focus and then going up each owner to see if they want the event combined with the global tables which are class based were enough to give me a headache ;) I'd prefer to leave it as it is and maybe use it as an inspiration for other kind of events. The big case switch of event processing in many gui toolkits has never been my cup of tea. Thierry Le 21/06/2013 16:38, Denis Kudriashov a écrit :
Hello.
Keymappings is very nice approach to subscribe on concrete system state instread of working with primitive event instances. And it can be generalized to support other events (not only key combinations). In this case subscribing API should not be related to key combinations
2013/6/19 Benjamin <benjamin.vanryseghem.pharo@gmail.com <mailto:benjamin.vanryseghem.pharo@gmail.com>>
Why not something like
bindKeyCombination:toAction:
?
Ben
On Jun 19, 2013, at 9:28 AM, Stéphane Ducasse <stephane.ducasse@inria.fr <mailto:stephane.ducasse@inria.fr>> wrote:
excellent so how do we integrate this change?
I will chnage the chapter on keymapping :)
On Jun 18, 2013, at 9:57 PM, Guillermo Polito <guillermopolito@gmail.com <mailto:guillermopolito@gmail.com>> wrote:
I prefer the onKeyCombination* because of the following rationale:
- to me a shortcut is the association between a key combination and an action - a key combination is a combination of keys :), which is associated with an action
Stef, so far I changed the asShortcut => asKeyCombination, following the same idea :).
Guille
On Tue, Jun 18, 2013 at 8:25 PM, Stéphane Ducasse <stephane.ducasse@inria.fr <mailto:stephane.ducasse@inria.fr>> wrote:
On Jun 18, 2013, at 7:21 PM, GOUBIER Thierry <thierry.goubier@cea.fr <mailto:thierry.goubier@cea.fr>> wrote:
> The problem with onkeypress, onkeydown, onkeyup is that they are low-level events compared to the shortcuts we are talking about. > > A shortcut is at least one key, but is usually a key + a modifier or a sequence of key + modifiers (such as the emacs ^X ^C ($x ctrl, $c ctrl). The Keymapping stuff sits a lot higher than the basic keypress events (which do exist as well) and can recognize multi-keys combinations. If you call that onKeyPress:do:, then you loose in the name part of the power of it. > > Hence the onKeyCombination:do: (but I prefer onShortcut:do:)
onShortcut:do: looks good to me.
Stef
> > Thierry > ________________________________________ > De : Pharo-dev [pharo-dev-bounces@lists.pharo.org <mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Esteban A. Maringolo [emaringolo@gmail.com <mailto:emaringolo@gmail.com>] > Date d'envoi : mardi 18 juin 2013 18:14 > à : Pharo Development List > Objet : Re: [Pharo-dev] on:do: for shortcuts? > > 2013/6/18 Clément Bera <bera.clement@gmail.com <mailto:bera.clement@gmail.com>> > >> On Javascript, there are : >> >> onkeypress >> onkeydown >> onkeyup >> >> >> I think we should have same API than other languages, especially popular ones. So 1 of these 3 would be the best for me. >> >> Why not onKeyPress:do: ? > > +1 to each of the last two statements. > >
-- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
participants (9)
-
Benjamin -
Clément Bera -
Denis Kudriashov -
Esteban A. Maringolo -
GOUBIER Thierry -
Goubier Thierry -
Guillermo Polito -
Igor Stasenko -
Stéphane Ducasse