Hello everybody,
how would I create a keyboard shortcut for a method I have defined in my class or package?
for example if I would like to have a keyboard shortcut for a method that opens the Transcript and display the “Hello I am the new shortcut” message?
thanks for the help.
peace.d
Hi peace.d,
I’ve had a quick look: you can inspire yourself from the class ToolShortcutsCategory.
The class has a couple of special things:
isGlobal
returning true on the class side (to say it defines global shortcuts)openUnitTestRunner
<shortcut>
^ KMKeymap shortcut: PharoShortcuts current openTestRunnerShortcut action: [ Smalltalk tools openTestRunner ]
If you want a shortcut only to be active on a particular tool/window, AND you’re using morphic, take a look at the methods in the Morph class related to keymappings:
Cheers,
Guille
El 20 oct 2021, a las 10:53, mspgate@gmail.com escribió:
Hello everybody,
how would I create a keyboard shortcut for a method I have defined in my class or package?
for example if I would like to have a keyboard shortcut for a method that opens the Transcript and display the “Hello I am the new shortcut” message?
thanks for the help.
peace.d
thanks a lot Guille, this is a good tip!