I have posted a pre-release of the latest Keymapping version. This is a pre-release so that I can get some feedback on the directions I'm taking this small enhancement. I don't recommend loading it into your production image. I have been using the current version for a few days now and it seems OK but I hook into keyboard event handling pretty early in the event chain so problems could leave you with a hosed image. Also, it conflicts with the Keymapping release on SqueakMap so don't load them into the same image. It requires Sixx and BFAV (I use the tab bar framework in that package). The latest can be found at:
http://www.cs.westminster.edu/~shaffer/cgi-bin/repository.cgi/Keymapping-cds...
Load it then evaluate: Keymap installTextMorphKeymap. Keymap installWorldKeymap "proceed through the exception"
Open a KeymapEditor (from the World open menu) and have a look.
Here are some of the new things in this pre-release:
. keymaps are now available for all morphs, not just TextMorphs . morphs belong to named keymap categories (see implementors of keymapCategories for details) - by default a morph belongs to a keymap category corresponding to its class name - PasteUpMorphs belong to categories PasteUpMorph and World (the later only if the PUM is a World) - all subclasses of TextMorph belong to the category TextMorph - TextMorphForEditView belongs to TextMorph and TextMorphForEditView . morph instances may have a "local keymap" (a per-instance keymap, that is) . keymap entry lookup works up the morph ownership chain . keymapping takes precedence over other keyboard handling (more later)
Bugs:
. I can't seem to get the PluggableListMorph to resize when the keymap editor is resized. Tried lots of things, failed miserably. Hints would be welcomed.
. Loading and saving need some work.
. There is currently no way to load a keymap (from a stream) and make it a local keymap for a specific morph. This can be done easily in code, however.
. It is currently not possible to delete a whole keymap (category) from the UI
. There are many keyboard combinations which aren't correctly translated by Keymapping. Some of them b/c the VM doesn't pass a distinct keyCode (under linux, for example, the home key and <c-a> produce the same keycode so you can't tell the difference between <c-home> and <c-a>). In others cases it's just because I haven't looked into it yet. This will be the next bug I squash.
Items I'm less than happy with and work to be done
. KMBlockActions are compiled in the nil context so "self" is meaningless. Not a big deal since you can get the target morph as an argument to the block but creating a block with: km addSequence: '<c-q>' action: (KMBlockAction block: [self doSomething]) can be confusing in the GUI (i.e. it won't work if accepted as-is). There will also be problems if you try to load a saved keymap containing this entry (KMBlockActions only save their source code and are recompiled upon loading).
. As mentioned above, keymap entries take precedence over keyboard events handled by keyStroke:. For example, the default keymap defines <m-t> to find a transcript. If you open a ProcessBrowser and try to use the terminate keyboard shortcut, it will raise a Transcript instead. This is easily corrected by moving all morphs over to using Keymaps :-)
. More existing morph shortcuts need to be converted to keymappings
. I should revisit rr's services framework in light of this redesigned package and supply a ServiceKeymapAction.
. Keymaps should report conflicting entries (same sequence or one sequence which is a prefix of another) and there should be a way to find conflicting entries in a morph ownership chain
As always, feedback is welcomed.
David
"C. David Shaffer" cdshaffer@acm.org wrote: It requires Sixx and BFAV (I use the tab
bar framework in that package).
Ugh, hefty dependency. Maybe we can include tab bar into Squeaks widgets ?
Karl
I second that. Can the BFAV guys extract the tab widget from BFAV
On 17 sept. 04, at 10:03, karl.ramberg@chello.se wrote:
"C. David Shaffer" cdshaffer@acm.org wrote: It requires Sixx and BFAV (I use the tab
bar framework in that package).
Ugh, hefty dependency. Maybe we can include tab bar into Squeaks widgets ?
Karl
Ken Causey came up with the (very sweet) tab bar framework. IIRC I integrated it into the BFAV package because Ken had no interest in maintaining it as a separate package.
David, AFAIK your KeyMapper package is the only one besides using Ken's tabs. Perhaps you could split out the tab bar as a separate SqueakMap package and become the owner/maintainer? That way the BFAV maintainers could choose to change their load script etc. to use the new package or not.
On Fri, 17 Sep 2004 07:03:54 -0100, karl.ramberg@chello.se karl.ramberg@chello.se wrote:
"C. David Shaffer" cdshaffer@acm.org wrote: It requires Sixx and BFAV (I use the tab
bar framework in that package).
Ugh, hefty dependency. Maybe we can include tab bar into Squeaks widgets ?
Karl
Sounds fine. I'll put it on SqueakSource and SqueakMap this afternoon.
David
Brent Vukmer wrote:
Ken Causey came up with the (very sweet) tab bar framework. IIRC I integrated it into the BFAV package because Ken had no interest in maintaining it as a separate package.
David, AFAIK your KeyMapper package is the only one besides using Ken's tabs. Perhaps you could split out the tab bar as a separate SqueakMap package and become the owner/maintainer? That way the BFAV maintainers could choose to change their load script etc. to use the new package or not.
On Fri, 17 Sep 2004 07:03:54 -0100, karl.ramberg@chello.se karl.ramberg@chello.se wrote:
"C. David Shaffer" cdshaffer@acm.org wrote: It requires Sixx and BFAV (I use the tab
bar framework in that package).
Ugh, hefty dependency. Maybe we can include tab bar into Squeaks widgets ?
Karl
Ken has asked me to hold off on this so I'm going to. I think I will be deploying Keymapping in a .sar, as I did before, so if needed I'll download the .mcz from his site using the sar preamble. I have squashed a number of bugs since yesterday's post and plan to keep doing so. I don't want to release until my PluggableListMorph resizing woes are fixed. Anyone with a few spare minutes that could take a look? I could just bow to the SystemWindow gods and use panes but, well, it just looks bad when your buttons draw themselves on top of the pane above or below them b/c you chose a moderately large font size.
David
C. David Shaffer wrote:
Sounds fine. I'll put it on SqueakSource and SqueakMap this afternoon.
David
Brent Vukmer wrote:
On Fri, 2004-09-17 at 11:05, Brent Vukmer wrote:
Ken Causey came up with the (very sweet) tab bar framework. IIRC I integrated it into the BFAV package because Ken had no interest in maintaining it as a separate package.
And I still don't. ;) But since it was requested I just mailed off the code extracted from BFAV 2.12 (class comments modified slightly) to the list as an enhancement. And if that doesn't fly it really is packaged up as an mcz so one can always manually install it from my repository. It just doesn't seem like something that needs to be listed on SqueakMap to me. *shrug*
Ken
Hi David,
This sounds nice overall, especially since all morphs can be keymapped. As others said, if you could not depend on BFAV this would be even nicer. Hopefully I will have some more free time next month, so we could see together how to integrate that with services.
Cheers, Romain
On Sep 17, 2004, at 5:26 AM, C. David Shaffer wrote:
I have posted a pre-release of the latest Keymapping version. This is a pre-release so that I can get some feedback on the directions I'm taking this small enhancement. I don't recommend loading it into your production image. I have been using the current version for a few days now and it seems OK but I hook into keyboard event handling pretty early in the event chain so problems could leave you with a hosed image. Also, it conflicts with the Keymapping release on SqueakMap so don't load them into the same image. It requires Sixx and BFAV (I use the tab bar framework in that package). The latest can be found at:
http://www.cs.westminster.edu/~shaffer/cgi-bin/repository.cgi/ Keymapping-cds.52.mcz Load it then evaluate: Keymap installTextMorphKeymap. Keymap installWorldKeymap "proceed through the exception" Open a KeymapEditor (from the World open menu) and have a look. Here are some of the new things in this pre-release:
. keymaps are now available for all morphs, not just TextMorphs . morphs belong to named keymap categories (see implementors of keymapCategories for details) - by default a morph belongs to a keymap category corresponding to its class name - PasteUpMorphs belong to categories PasteUpMorph and World (the later only if the PUM is a World) - all subclasses of TextMorph belong to the category TextMorph - TextMorphForEditView belongs to TextMorph and TextMorphForEditView . morph instances may have a "local keymap" (a per-instance keymap, that is) . keymap entry lookup works up the morph ownership chain . keymapping takes precedence over other keyboard handling (more later) Bugs:
. I can't seem to get the PluggableListMorph to resize when the keymap editor is resized. Tried lots of things, failed miserably. Hints would be welcomed. . Loading and saving need some work. . There is currently no way to load a keymap (from a stream) and make it a local keymap for a specific morph. This can be done easily in code, however. . It is currently not possible to delete a whole keymap (category) from the UI . There are many keyboard combinations which aren't correctly translated by Keymapping. Some of them b/c the VM doesn't pass a distinct keyCode (under linux, for example, the home key and <c-a> produce the same keycode so you can't tell the difference between <c-home> and <c-a>). In others cases it's just because I haven't looked into it yet. This will be the next bug I squash.
Items I'm less than happy with and work to be done
. KMBlockActions are compiled in the nil context so "self" is meaningless. Not a big deal since you can get the target morph as an argument to the block but creating a block with: km addSequence: '<c-q>' action: (KMBlockAction block: [self doSomething]) can be confusing in the GUI (i.e. it won't work if accepted as-is). There will also be problems if you try to load a saved keymap containing this entry (KMBlockActions only save their source code and are recompiled upon loading). . As mentioned above, keymap entries take precedence over keyboard events handled by keyStroke:. For example, the default keymap defines <m-t> to find a transcript. If you open a ProcessBrowser and try to use the terminate keyboard shortcut, it will raise a Transcript instead. This is easily corrected by moving all morphs over to using Keymaps :-)
. More existing morph shortcuts need to be converted to keymappings . I should revisit rr's services framework in light of this redesigned package and supply a ServiceKeymapAction. . Keymaps should report conflicting entries (same sequence or one sequence which is a prefix of another) and there should be a way to find conflicting entries in a morph ownership chain
As always, feedback is welcomed.
David
squeak-dev@lists.squeakfoundation.org