dumbeau / AutoHotPie

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

Request: Use double click of a key or mouse button as Pie Key #21

Open heldheld opened 2 years ago

heldheld commented 2 years ago

I'd love to be able to access the Pie Menu by only using the mouse. The current Pie Key options don't really allow for that in a practical way. A solution could be to add an option for a double click of either a key or a mouse button to open the menu. Double clicking the middle mouse button, for example, would be pretty convenient I think.

Keep up the awesome work, in my search for the best pie/radial menu this is by far the most visually appealing and functionally fastest to use!

dumbeau commented 2 years ago

This is a good idea, I don't know if I will be able to add it easily though.

For the time being (although I'm sure you've already considered these options) I'd say take a look at the Back and Forward mouse buttons if you have them. Otherwise, you can use MMB or RMB with a modifier key, or use the 'Profile Enable Key' to set any keystroke to be used as a kind of modifier key.

I'm happy you find this useful! Fast and pretty was definitely my goal here.

heldheld commented 2 years ago

This setup could actually work: [Setting the Pie Enable Key to the back button and Pie Key to MMB], if it didn't completely disable the actual back function of the back key. Is there any way to avoid this? Say, have the Pie Enable Key functionality work as long as you hold down the key, but on up/release still send the original key's function? The back and forward functions already work on key up/release so it wouldn't change anything in the rest of the OS I think.

dumbeau commented 2 years ago

Yeah that could work, like I just set up the 'Profile Enable Key' if it's in hold mode to send the original key's function if no pie menu is launched when it is released. This would have a checkbox option. Lmk if this would work for you. image

heldheld commented 2 years ago

This would be great! :)

heldheld commented 2 years ago

Yeah that could work, like I just set up the 'Profile Enable Key' if it's in hold mode to send the original key's function if no pie menu is launched when it is released. This would have a checkbox option. Lmk if this would work for you. image

So, is this something you're planning to incorporate? Not trying to rush you or anything, just wondering if that was the conclusion if this conversation.

dumbeau commented 2 years ago

Yes I do plan on doing this 👍, shouldnt keep you waiting too long. I'm planning on having a version up tomorrow.

heldheld commented 2 years ago

Amazing, looking forward to it!

dumbeau commented 2 years ago

Thanks for waiting on this, v1.0.16 will have this checkbox option. I'm going to be testing this on my end more but lmk if you run into anything unexpected.

heldheld commented 2 years ago

I've uninstalled the previous version, installed the new one, closed all my other scripts and restarted my pc to be sure. This new feature doesn't seem to do anything for me. I at least tried it with each of the mouse buttons as Profile Enable Key and none kept their original function, either with the checkbox ticked or without. Does it work on your end?

dumbeau commented 2 years ago

yeaaaupp I see the issue, fixing this now.

dumbeau commented 2 years ago

Alright... lets give it another try here (no rush though), v1.0.16

I updated the installer, and you shouldn't have to uninstall for this, simple reinstall should do it. Lmk what happens on your end.

heldheld commented 2 years ago

Yes! It works :). It breaks my other scripts that I have bound to 'Back' but that's fine. Instead I can do MMB as Profile Enable Key and RMB as Pie Key, that suits me quite nice!

Another thing I noticed: In trying to make a workaround for my own scripts to work with this I rebound Back to be F18 and used F18 as Profile Enable Key. And even though it recognises the button as F18 when I press it to assign it, it will not work in practice. I tried some more and it seems that any key bound to be a different key will not work for the Profile Enable Key (Also not as Pie Key). I don't know if this is by design or not? IF you could fix that it would be very appreciated but I'm already very happy with this new working checkbox :D

ps. I just realised that if you could fix the key binds not being recognised I could probably make my original plan for double clicking a mouse key to acces a Pie Menu work with a script of my own...

dumbeau commented 2 years ago

heck yea I'll take a small win for the day!

What software are you using to rebind your keys? AHK or hardware specific software?

heldheld commented 2 years ago

AHK. Just a simple setup like this for example doesn't work:

AHK script: XButton1::d

AutoHotPie: No Profile Enable Key, Pie Key = d (with 'hover over all selections'). XButton1 is the 'Back' button. Using 'Back' prints a 'd' in any text field but it doesn't open the Pie Menu. Using the regular 'd' key does open the Pie Menu.

dumbeau commented 2 years ago

So really we just need a way of getting the "~" on the Profile Enable Key in order to keep my app from stealing the "Back" from your scripts, at least to solve your problem in a cleaner way. You could technically do this by modifying the JSON settings file, but then the settings UI won't read the file correctly. I'll see if it would be easy to make it so adding that symbol doesn't break everything, if this seems useful.

Considering I don't know exactly how your scripts are using the "Back" function, I might be missing the mark here.

heldheld commented 2 years ago

I'm not sure if ~ could work. Maybe it could. Is there not maybe a way to make autohotpie recognize rebound keys? I mean it does, like I said, whenever you go to set it as a Pie Key. But then it doesn't when you actually try to use it after saving and running. I think solving this would open up a lot of custom usage options for people who would like that, assuming this is at all possible.

If it helps btw, I attached my script for you to inspect. It's basically AltDrag but my own version, and with XButton1. Paired with some simple volume control (which btw I have set up using F15/F16 for my own setup because of crazy audio routing but it defaults to normal use for anyone not having my master file so don't worry about that haha) Back Magic.zip

dumbeau commented 2 years ago

Jeez that window drag function works really well.

This makes me think the tilde won't work as you've been saying, only because then blocking 'Back' if no menu is launched wouldn't be handled unless you did more to your back magic script which would start getting messy. You are essentially using 'Back' as a modifier key in a similar way that I am using the 'Profile Enable Key' to allow pie menus to run. If you're desperate, we can test if this '~' would work on your end and you might not have to use the 'Send original keystroke' checkbox. Just search for this key object: "pieEnableKey": { "useEnableKey": true, "enableKey": "XButton1", "toggle": false, "sendOriginalFunc": false } Then just add the tilde to the enable key value. "enableKey": "XButton1", => "enableKey": "~XButton1",

Then try and run the actual PieMenu.exe found in the installation considering the settings UI will error out if you try to : "C:\Users{username}\AppData\Local\Programs\AutoHotPie\resources\src\PieMenu.exe"

No pressure to try this though, I'm only mentioning this 'solution' in case it points to any other non-garbage fix. The best solution here still seems like it would be an importable PieMenu AHK class type.

heldheld commented 2 years ago

Thanks, Back Magic is my proudest scripting achievement hahaha.

There's an inherent problem with using the tilde and that is that the original function of the key will always persist (which is a solution and also a problem). I put the ~ in the place you suggested and just turned my other scripts off for testing. Of course the AutoHotPie menu works, but also the back function persists. So if I have File Explorer or a browser open, that program will also go back a page which is not what you want. So the ~ sounds good in theory but in practice it doesn't work all that well. That said, I imagine there are ways around this that I don't know.

The tilde doesn't make AHP work when Back Magic is running though.

I also tried to implement the AHP and Back Magic script together in a single script but couldn't really figure out how to make it work.

heldheld commented 2 years ago

Any updates on this request? A double click Pie Key would still be a great feature imo.

Btw, I've noticed for a long while now that AHP doesn't work reliably for me. When I haven't used it for some minutes (I'm not exactly sure how long) it doens't turn on anymore when I use the designated hotkey. I have to restart the script via the tray icon to be able to get it to work again. Is this a known bug? Does it happen to you too? I've had this with multiple releases since we last posted in this thread. I use MMB as Profile Enable Key and RMB as Pie Key.

rexelbartolome commented 2 years ago

Hmmmm whenever something like that happens, I can't left click on anything but I'm still able to right click which means I can right click on the tray like you. Can't tell why it happens since it doesn't happen often enough to me. I don't use MMB/RMB as Profile Enable though.

heldheld commented 2 years ago

Hmmmm whenever something like that happens, I can't left click on anything but I'm still able to right click which means I can right click on the tray like you. Can't tell why it happens since it doesn't happen often enough to me. I don't use MMB/RMB as Profile Enable though.

This is a seperate issue as I do not have the experience of my left click being blocked. For me the hotkeys to call AHP just stop working after a few minutes of not using it. All other functionality in Windows or other programs is unaffected.

dumbeau commented 2 years ago

Yikes, welp, those are both definitely big issues.

I can't left click on anything

Added issue #38

the hotkeys to call AHP just stop working after a few minutes of not using it.

Added issue #39

Any updates on this request? A double click Pie Key would still be a great feature imo.

Sorry work has just been getting worky lately, haven't really had much time for larger updates. The issue I ran into with this is that I can't block the first key press of the double press, so it's not as clean as I'd like to commit as an official feature. If you believe it would still be useful though, please refute me. For features like this is where I want to make the importable AHK class type, and I'd have to use AHKv2 for it, maybe switching to v2 would help other issues too. Also, this person apparently got a simulated keystroke to be intercepted by another AHK script by switching to the 'open source' version in the settings (#31).

heldheld commented 2 years ago

Sorry work has just been getting worky lately, haven't really had much time for larger updates.

No need to apologies, I appreciate all the time you spend on this project for us :)

If you believe it would still be useful though, please refute me.

All I can really say is this. For me, AHP is at it's most useful and convienent if I can operate it using only the mouse. Since the menu inherently needs you to point with the mouse you will already have your hand at the mouse but depending on the current task you won't necessarily have a hand at the keyboard. Using a double click of any mouse button (of course disregarding LMB) would be a fast and easy to use method of using AHP. Sacrificing any one click of a mouse button is not really an option. Having a setup like MMB as Profile Enable Key and RMB as Pie Key (which I use now) does work but requires a conscience effort to perform which "disrupts" the workflow. Therefor, a double click would be the most elegant solution. This concludes my TED talk ;p

Also, this person apparently got a simulated keystroke to be intercepted by another AHK script by switching to the 'open source' version in the settings (#31).

I checked it out. Seems like that person accomplished to do the opposite of what I'm trying to do. They got another AHK script to recognise a virtual input created by AHP whereas I am trying to make AHP recognise a virtual input created by another AHK script. Switching to the open-source version didn't work for this unfortunately. So just to reiterate, a setup like this for example does not work:

AHK: o::p

Pie Key: p

Pressing o will not open the Pie Menu, pressing p will. This is the same if you use either 'send' or 'sendevent' in AHK. Note: Remarkably, AHP does recognise the 'o' key as the 'p' key when I go to set it as the Pie Key.