Global shortcut keys in Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Global shortcut keys in Pharo

tfleig
I find myself wanting global keyboard shortcuts for such things as
invoking an external browser, switching focus between windows, opening
new tool windows, executing various World menu options, executing my
own scripts, etc.

After working for years in corporations doing Windows-based
development in Microsoft Visual Studio, I find the necessity of
constantly reaching for the mouse in Pharo to be cumbersome and
unproductive.

I was able to add some shortcut keys to invoke commands that I
prepared by sending messages like this:

    World respondToCommand: $l bySending: #startExternalWebBrowser to:
TFCommands.

However, this only works when no window has the keyboard focus.

I followed the keystroke handling path in the debugger and I think I
can probably find a place to hook in some special handling for my
globally-accessible keystrokes.

My questions are:

1. Has somebody already done this?

2. Is there a "standard" or "best practice" way of accomplishing this?

Regards,
TF

Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Mariano Martinez Peck
Hi Tony. Yes, I agree with you. There have been several works arround this. I remember Guillermo Polito or Sean working on KeyMapping, KeyBindings or something like that.

Check in the archive...there are hundreds of emailsa about that:

http://forum.world.st/Keyboard-Shortcuts-Keymapping-now-loads-in-Pharo-core-1-2-td2318018.html

cheers

mariano

On Sat, Dec 4, 2010 at 5:19 AM, Tony Fleig <[hidden email]> wrote:
I find myself wanting global keyboard shortcuts for such things as
invoking an external browser, switching focus between windows, opening
new tool windows, executing various World menu options, executing my
own scripts, etc.

After working for years in corporations doing Windows-based
development in Microsoft Visual Studio, I find the necessity of
constantly reaching for the mouse in Pharo to be cumbersome and
unproductive.

I was able to add some shortcut keys to invoke commands that I
prepared by sending messages like this:

   World respondToCommand: $l bySending: #startExternalWebBrowser to:
TFCommands.

However, this only works when no window has the keyboard focus.

I followed the keystroke handling path in the debugger and I think I
can probably find a place to hook in some special handling for my
globally-accessible keystrokes.

My questions are:

1. Has somebody already done this?

2. Is there a "standard" or "best practice" way of accomplishing this?

Regards,
TF


Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

EstebanLM
Hi,
Yes, AFAIK, Guille is working in something like that :)

Cheers,
Esteban

El 05/12/2010, a las 10:41a.m., Mariano Martinez Peck escribió:

Hi Tony. Yes, I agree with you. There have been several works arround this. I remember Guillermo Polito or Sean working on KeyMapping, KeyBindings or something like that.

Check in the archive...there are hundreds of emailsa about that:

http://forum.world.st/Keyboard-Shortcuts-Keymapping-now-loads-in-Pharo-core-1-2-td2318018.html

cheers

mariano

On Sat, Dec 4, 2010 at 5:19 AM, Tony Fleig <[hidden email]> wrote:
I find myself wanting global keyboard shortcuts for such things as
invoking an external browser, switching focus between windows, opening
new tool windows, executing various World menu options, executing my
own scripts, etc.

After working for years in corporations doing Windows-based
development in Microsoft Visual Studio, I find the necessity of
constantly reaching for the mouse in Pharo to be cumbersome and
unproductive.

I was able to add some shortcut keys to invoke commands that I
prepared by sending messages like this:

   World respondToCommand: $l bySending: #startExternalWebBrowser to:
TFCommands.

However, this only works when no window has the keyboard focus.

I followed the keystroke handling path in the debugger and I think I
can probably find a place to hook in some special handling for my
globally-accessible keystrokes.

My questions are:

1. Has somebody already done this?

2. Is there a "standard" or "best practice" way of accomplishing this?

Regards,
TF



Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Sean P. DeNigris
Administrator
In reply to this post by Mariano Martinez Peck
Mariano Martinez Peck wrote
I remember... Sean working on KeyMapping, KeyBindings or
something like that.
Yes, I ported KeyMapping to Pharo because it seemed like the model people liked best.  IIRC KeyBindings probably wouldn't be too hard to port.  Both are on SqueakSource, but if I didn't have write access, check my SqS projects page for updated versions.

Cheers,
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

tfleig
Sean, what is the URL of your SqS projects page?

TF

On Sun, Dec 5, 2010 at 6:59 AM, Sean P. DeNigris <[hidden email]> wrote:

>
>
> Mariano Martinez Peck wrote:
>>
>> I remember... Sean working on KeyMapping, KeyBindings or
>> something like that.
>>
>
> Yes, I ported KeyMapping to Pharo because it seemed like the model people
> liked best.  IIRC KeyBindings probably wouldn't be too hard to port.  Both
> are on SqueakSource, but if I didn't have write access, check my SqS
> projects page for updated versions.
>
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Global-shortcut-keys-in-Pharo-tp3072091p3073313.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Guillermo Polito
Yes Yes Yes!!! I'll push on that! :D  Let's join forces, it's better than be alone in the dark :).

On Sun, Dec 5, 2010 at 9:48 PM, Tony Fleig <[hidden email]> wrote:
Sean, what is the URL of your SqS projects page?

TF

On Sun, Dec 5, 2010 at 6:59 AM, Sean P. DeNigris <[hidden email]> wrote:
>
>
> Mariano Martinez Peck wrote:
>>
>> I remember... Sean working on KeyMapping, KeyBindings or
>> something like that.
>>
>
> Yes, I ported KeyMapping to Pharo because it seemed like the model people
> liked best.  IIRC KeyBindings probably wouldn't be too hard to port.  Both
> are on SqueakSource, but if I didn't have write access, check my SqS
> projects page for updated versions.
>
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Global-shortcut-keys-in-Pharo-tp3072091p3073313.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Guillermo Polito
Downloading Keymapping from sqs...

Gofer it
  squeaksource: 'Keymapping';
  package: 'ConfigurationOfKeymapping';
  load.
(ConfigurationOfKeymapping project version: '1.0') load

:)

On Mon, Dec 6, 2010 at 4:01 PM, Guillermo Polito <[hidden email]> wrote:
Yes Yes Yes!!! I'll push on that! :D  Let's join forces, it's better than be alone in the dark :).


On Sun, Dec 5, 2010 at 9:48 PM, Tony Fleig <[hidden email]> wrote:
Sean, what is the URL of your SqS projects page?

TF

On Sun, Dec 5, 2010 at 6:59 AM, Sean P. DeNigris <[hidden email]> wrote:
>
>
> Mariano Martinez Peck wrote:
>>
>> I remember... Sean working on KeyMapping, KeyBindings or
>> something like that.
>>
>
> Yes, I ported KeyMapping to Pharo because it seemed like the model people
> liked best.  IIRC KeyBindings probably wouldn't be too hard to port.  Both
> are on SqueakSource, but if I didn't have write access, check my SqS
> projects page for updated versions.
>
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Global-shortcut-keys-in-Pharo-tp3072091p3073313.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Guillermo Polito
Ok, I've uploaded version 1.1 of the configuration with some little fixes.

On Mon, Dec 6, 2010 at 4:07 PM, Guillermo Polito <[hidden email]> wrote:
Downloading Keymapping from sqs...

Gofer it
  squeaksource: 'Keymapping';
  package: 'ConfigurationOfKeymapping';
  load.
(ConfigurationOfKeymapping project version: '1.0') load

:)


On Mon, Dec 6, 2010 at 4:01 PM, Guillermo Polito <[hidden email]> wrote:
Yes Yes Yes!!! I'll push on that! :D  Let's join forces, it's better than be alone in the dark :).


On Sun, Dec 5, 2010 at 9:48 PM, Tony Fleig <[hidden email]> wrote:
Sean, what is the URL of your SqS projects page?

TF

On Sun, Dec 5, 2010 at 6:59 AM, Sean P. DeNigris <[hidden email]> wrote:
>
>
> Mariano Martinez Peck wrote:
>>
>> I remember... Sean working on KeyMapping, KeyBindings or
>> something like that.
>>
>
> Yes, I ported KeyMapping to Pharo because it seemed like the model people
> liked best.  IIRC KeyBindings probably wouldn't be too hard to port.  Both
> are on SqueakSource, but if I didn't have write access, check my SqS
> projects page for updated versions.
>
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Global-shortcut-keys-in-Pharo-tp3072091p3073313.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>




Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

Sean P. DeNigris
Administrator
In reply to this post by tfleig
tfleig wrote
Sean, what is the URL of your SqS projects page?
MCHttpRepository
    location: 'http://www.squeaksource.com/SPDProjectUpdates'
    user: ''
    password: ''
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Global shortcut keys in Pharo

tfleig
In reply to this post by tfleig
A follow-up:

I scanned the email threads mentioned in this thread.

I tried to use Keymapper and it seemed way too complicated for the
simple things I wanted to do. It wasn't obvious at all to me how to
proceed once I had the GUI displayed and I encountered numerous errors
while exploring it. After perusing the code a little, it seemed much
more invasive than what I had in mind -- extensions and overrides in
numerous classes. It seems to be a general approach for solving
keystroke mapping not only at the global level, but in
application-specific cases as well.

I have placed my own GlobalKeys package on SqueakSource
(http://www.squeaksource.com/GlobalKeys) It is much smaller and less
ambitious than Keymapper, it only works on Pharo, and it is much less
capable, but at least in my environment it does what I need without a
lot of complication. Maybe someone else will find it useful as well.

One of the joys of Smalltalk: if you don't like the way something
works, change it or write your own.

Regards,
TF

On Fri, Dec 3, 2010 at 8:19 PM, Tony Fleig <[hidden email]> wrote:

> I find myself wanting global keyboard shortcuts for such things as
> invoking an external browser, switching focus between windows, opening
> new tool windows, executing various World menu options, executing my
> own scripts, etc.
>
> After working for years in corporations doing Windows-based
> development in Microsoft Visual Studio, I find the necessity of
> constantly reaching for the mouse in Pharo to be cumbersome and
> unproductive.
>
> I was able to add some shortcut keys to invoke commands that I
> prepared by sending messages like this:
>
>    World respondToCommand: $l bySending: #startExternalWebBrowser to:
> TFCommands.
>
> However, this only works when no window has the keyboard focus.
>
> I followed the keystroke handling path in the debugger and I think I
> can probably find a place to hook in some special handling for my
> globally-accessible keystrokes.
>
> My questions are:
>
> 1. Has somebody already done this?
>
> 2. Is there a "standard" or "best practice" way of accomplishing this?
>
> Regards,
> TF
>