dumbeau / AutoHotPie

Radial menus in Windows, aka PIE MENYOOS!
MIT License
340 stars 18 forks source link

Copy submenus to another menu #20

Open sgrodnik opened 2 years ago

sgrodnik commented 2 years ago
  1. Hi, could you please write a short tutorial about how to copy submenus to another menu in the settings file? I haven't coped with the structure of the json. Also, you can consider adding such a feature to GUI.
  2. Or even more, maybe it is possible to create a "shared" submenu and attach it to many menus? For example, it would be nice to have only one Copy-paste submenu and attach it to many menus: Browser, Text editor, and messenger menus. And then change it just once. Magic. Until we have to switch between menus often, I am interested in faster navigation to all menus and submenus. Maybe some Tree-view on the left?
  3. Another idea: Suggest the name of a new slice based on its function. Now it is just Slice N.
  4. Another idea: Now we can move slices by dragging. It could be useful to copy them by Ctrl-drag.
  5. Another idea: Multimedia Keys support Multimedia Keys (like Media_Play_Pause) in send key function.
  6. Another idea: any sequence of keys (like ^+!#{Enter 2} in ahk send) support in send key function.
  7. Another idea: At least partial #IfWinActive directive support in send key function.

Thank you for your great work! Sorry for my poor English :)

dumbeau commented 2 years ago
  1. I'll probably opt for adding this to the GUI, there is definitely some refactoring that needs to be done to the handling of submenus, but when I get to that I'll plan on modifying it to make this easier. But if I can't, I'll post back here.
  2. Instancing submenus is definitely a good idea to have, the best thing I have at the moment is the 'Global' checkbox on the default profile pie menus. However this applies an entire pie menu across all profile as opposed to making globally accessible submenus.
  3. Yeah I definitely need to do that, this is one of those things where I kind of knew I should address it, but just didn't because I was excited to get this out.
  4. Ctrl-drag copy makes sense to me, do you find yourself making copies of functions onto other slices frequently?
  5. Media keys should work, heck I can even put pie menus on those buttons. Are they not working on your end? These keys should be added to the Special Keys dropdown though, because I know some keyboards might not have these buttons.
  6. If you need this functionality, I'd say just make a simple ahk script to be ran by a pie menu Run Script function. Otherwise I do have a plan to add 'Custom Functions' in the future that allows users to write in AHK code into functions directly.
  7. By this I'm assuming you're already aware that you can add application-specific pie menu profiles and what you want is to add another level of #IfWinActive for sensing windows created by the same application. If this is the case, I think this is also another situation where you're probably going to want Custom Functions. Otherwise, I did have a plan to create a Pie Menu AHK class that can be configured in this UI, then exported to an AHK file that can be imported and used in a user's AHK script. This way people fluent in AHK can do whatever they want with these menus.

I'm happy you find this useful!

sgrodnik commented 2 years ago
  1. Not so often, but I feel great laziness every time I edit my layout)
  2. You are right, I don't have media keys. I typed them manually in the settings file and it works.
  3. Nice! It is a must-have function.
  4. My case: One menu for a group of apps (for ex. text editors), but they have slightly different hotkeys (ex. Ctrl+Y vs Ctrl+Shift+Z). So I need #IfWinActive to distinct apps, not windows of an app. Yes, Custom Functions (raw ahk) would be great here too.
dumbeau commented 2 years ago
  1. Not so often, but I feel great laziness every time I edit my layout)

I may delay this feature, in order to work on other things. I'll add it if the 'copy' function is simple enough though.

  1. You are right, I don't have media keys. I typed them manually in the settings file and it works.

Got it 👍, I will add these buttons ASAP (I think I'll have this up in about 24 hours)

  1. My case: One menu for a group of apps (for ex. text editors), but they have slightly different hotkeys (ex. Ctrl+Y vs Ctrl+Shift+Z). So I need #IfWinActive to distinct apps, not windows of an app. Yes, Custom Functions (raw ahk) would be great here too.

Oh, well good news, I already support this!

  1. Click this: image
  2. Name profile and locate executable: image
  3. Now you have a new application profile for notepad and you can add more programs to the same profile. image

Let me know if you run into any issues with this. I really need to add some proper documentation for this app.

rexelbartolome commented 2 years ago
  1. Another idea: any sequence of keys (like ^+!#{Enter 2} in ahk send) support in send key function.

In case you want a more complicated sequence of events. I recommend Pulover's Macro Creator, an amazing program on its own and it can basically record a sequence of mouse clicks, send keys, or even window focus/activation. You can also opt to record the delays between the actions or have a set key delay of some sort, all configurable. After recording, you can export it to an AHK file: by default it asks you where to bind the macro to (there's no option for leaving it unbound) but with a bit of tweaking you can just edit the keybind out and it's ready to be used for AHP.

For example, this is what the exported ahk looks like so I deleted these lines: image

After adding the Run File function, it works like a charm!

https://user-images.githubusercontent.com/88552647/151524295-f37fdaf9-8df1-4ec9-bf26-0ef8c95af931.mp4

  1. Another idea: Suggest the name of a new slice based on its function. Now it is just Slice N.

I also like having some sort of default or suggested names when configuring the slices. Maybe if the function was a Send Key, it would suggest using the keyboard shortcut as the actual name of the slice.

Something like this:

https://user-images.githubusercontent.com/88552647/151524898-c2f48a98-cbec-4aaa-acd4-b295c8e0f32d.mp4

sgrodnik commented 2 years ago

Oh, well good news, I already support this!

No, I guess my previous description was not clear :) let's consider an imaginary case (because mine real ones are too crazy to discuss): I already have such a profile (for notepad.exe and sublimeText.exe). One of them for "Undo" uses Ctrl-Z, another Ctrl-Shift-Z (it is not true, we are imagining). Also I have a submenu for basic text operations (copy/paste/selectAll/undo/redo etc.). Today I have to have two distinct profiles and two almost the same submenus:

  1. copy/paste/selectAll/undo(variant 1)/redo;
  2. copy/paste/selectAll/undo(variant 2)/redo.

My idea is to have just one profile, but different behaviour for different apps of the profile:

  1. copy/paste/selectAll/ #IfWinActive(notepad.exe){undo_variant_1}; #IfWinActive(sublimeText.exe){undo_variant_2} /redo;
  2. Profit!
sgrodnik commented 2 years ago

Yes, I'm aware of Pulover's Macro Creator. Its idea is truly amazing. But creating lots of separate .ahk scripst is quite a botch is the case of the feature under discussion (Custom Function). By the way, I've not coped with PMC in case of a complex macro with multiple WinWait steps. So I put it aside :(

sgrodnik commented 2 years ago
  1. Another idea: I might want to implement such a logic: the left half (MouseGetPos...) of my screen should fire one menu, and the right half fires another menu (I use RMB as a pieKey). Guess it's a case exactly for the #IF directive.
dumbeau commented 2 years ago

Another idea: Suggest the name of a new slice based on its function. Now it is just Slice N. I also like having some sort of default or suggested names when configuring the slices. Maybe if the function was a Send Key, it would suggest using the keyboard shortcut as the actual name of the slice.

This has been added to v1.0.16, works pretty much how @rexelbartolome depicted. Default labels have also been added for all the other functions.

@sgrodnik for the time being, creating an AHK script with your #IF directives in the script is your best bet at the moment until Custom Functions are added (which will be functionally identical anyway, just faster).

Another idea: I might want to implement such a logic: the left half (MouseGetPos...) of my screen should fire one menu, and the right half fires another menu (I use RMB as a pieKey). Guess it's a case exactly for the #IF directive.

Now this is something Custom Functions would not address. I see this as something that will have to be handled by the PieMenu AHK class type to import into your own scripts. I just don't see a clean way to implement this on my end.

ryjacky commented 1 year ago

for 2., Menu instancing and copying is addressed in #109

Which functions similarly to material instancing in blender in terms of the UI.