Hi Tones,

To test, I made one to pop up HelloThere in a modal, by following the 
directions in the Keyboard Shortcut Tiddler tiddler. 
<https://tiddlywiki.com/#Keyboard%20Shortcut%20Tiddler>

Overview: I had to create two tiddlers, then go into Control Panel -> 
Keyboard Shortcuts to set the key combination for the shortcut.

I called my shortcut "canscut".

First I made a tiddler with an arbitrary title, whose text field contains 
the action I want the shortcut to invoke; in this case:

<$action-sendmessage $message="tm-modal" $param="HelloThere" />

I added a field with name key and value ((canscut)), and tagged it 
$:/tags/KeyboardShortcut. That takes care of setting up the actions and the 
reference key so the shortcut can be referred to in macros without being 
opinionated on what its specific key combo should be.

Then I created the tiddler $:/config/ShortcutInfo/canscut -- I didn't have 
to put anything into it; that's enough to add a row into the appropriate 
part of Control Panel -> Keyboard Shortcuts, so that the key combo can be 
set interactively. Once I used that interface to set the key combination, 
the tiddler $:/config/shortcuts/canscut was generated with shift-cmd-G in 
the text field.

And voila, now if I hit shift-cmd-G, I get the HelloThere tiddler in a 
modal.

Hope that helps,
Chris
On Monday, January 25, 2021 at 8:24:56 PM UTC-5 TW Tones wrote:

> Have you found a easy to use way to create your own global shortcuts?
>
> I found a few times trying to understand the keyboard shortcuts some gaps 
> in the doco. First I would like to understand, then update the doco.
>
> Tones
>
> On Tuesday, 26 January 2021 at 12:12:03 UTC+11 clutterstack wrote:
>
>> Haha, I'm just looking at the source for the keyboard-driven-input macro 
>> and it has five nested keyboard widgets, so I venture a guess that 
>> there's not an obviously better way just now.
>>
>> Best,
>> Chris
>>
>> On Monday, January 25, 2021 at 7:56:55 PM UTC-5 clutterstack wrote:
>>
>>> Thanks Tones,
>>>
>>> I had another look at the global keyboard shortcuts, and I haven't tried 
>>> it, but the presence of duplicate key combinations in the shortcut list 
>>> does make me hopeful that I might be able to just add more duplicate global 
>>> shortcuts and have them work appropriately with a macro that only works 
>>> under, as you say, given conditions. It does sound like something that 
>>> could require careful thought to avoid conflict. But definitely something 
>>> to think about!
>>>
>>> For now, I think I'll leave my nested keyboard widgets in place, since 
>>> they work and haven't caused me any grief, unless it's through a 
>>> performance hit. I certainly have other optimisations I can focus on!
>>>
>>> Best,
>>> Chris
>>> On Sunday, January 24, 2021 at 4:58:22 PM UTC-5 TW Tones wrote:
>>>
>>>> Clutterstack,
>>>>
>>>> I am no expert in keyboard shortcuts for sure, but with 5.1.23 we can 
>>>> now use the modifier keys, so alt- shift- ctrl- can be interrogated in the 
>>>> actions macro if appropriate you can then use one key, 3-4 modifier keys 
>>>> so 
>>>> perhaps a global short cut that responds to conditions and modifier keys 
>>>> is 
>>>> another approach.
>>>>
>>>> Regards
>>>> Tones
>>>>
>>>> On Sunday, 24 January 2021 at 15:02:39 UTC+11 clutterstack wrote:
>>>>
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I have, in some of my macros, three nested keyboard widgets to listen 
>>>>> for three different key combinations. I'm just wondering whether this is 
>>>>> the best way to accomplish that. I don't think I want to assign keyboard 
>>>>> shortcuts for the whole wiki, because I may want different actions for 
>>>>> the 
>>>>> same key or key combination, based on the event target.
>>>>>
>>>>> Am I missing something?
>>>>>
>>>>> Best,
>>>>> Chris
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/60ec8055-c9d0-487f-ae1b-d77fc22cda6fn%40googlegroups.com.

Reply via email to