Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I restrict the context menu to appear only when the Shift key is held down? #138

Closed
Glavor opened this issue Dec 6, 2023 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@Glavor
Copy link

Glavor commented Dec 6, 2023

Is your feature request related to a problem? Please describe.
I'd like infrequently used menus to show up exclusively when I right-click while holding down the Shift key.

Describe the solution you'd like
Right-click while holding down the Shift key to display expanded menus.

Describe alternatives you've considered
N/A

Additional context
N/A

@Glavor Glavor added the enhancement New feature or request label Dec 6, 2023
@end2endzone
Copy link
Owner

Hi. Thank you for showing interest in ShellAnything. I forgot to create an issue to implement this feature a few releases ago and never took time to do so. Shame on me, for procrastinating this kind of feature which is already available with multiple other software that extends the shell.

Unfortunately, there is no way at the moment to do something like that. If you are kind of in a hurray, there would be a workaround. With the latest release, you could implement such a feature by developing you own plugin. However, such a feature would preferably be native to the application. I will add this issue for the next release milestone.

I would like to take the opportunity to get more feedback from you.
How would you have expected to use such a feature ?
Here is a quick tough...

  1. With a keyboard attribute in the Visibility / Validity elements ?
    For example:
<menu name="This menu is only visible with keyboard ALT and SHIFT keys are pressed">
  <visibility keyboard="alt;shift" />
</menu>
  1. With keyboard specific Properties ? I could define a new series of properties that matches the keyboard keys states.
    For example:
<menu name="This menu is only visible with keyboard ALT and SHIFT keys are pressed">
  <visibility properties="keyboard.alt;keyboard.shift" />
</menu>

I think the second option is less intuitive but it would allow more versatility.
I could even end up implementing both options.

@end2endzone end2endzone added this to the 0.9.0 milestone Dec 6, 2023
@Glavor
Copy link
Author

Glavor commented Dec 6, 2023

Thank you for your response.

I lean towards the first option, utilizing a keyboard attribute within the Visibility/Validity elements. It's succinct, intuitive, and I believe it suffices to cover the requirements in most cases. I also agree with your point that the second option could offer more functionality.

@Aptronymist
Copy link

Aptronymist commented Dec 7, 2023

If you don't mind me butting in as well, would it be possible to allow SA to pop up a menu inside of something that wasn't Explorer-based?
For example, use the hotkey and click in inside of any application to access some of the menus, ones that weren't dependent on files/directories of course, but say you could highlight text in your browser, bring up the menu (w/hotkey) and use that text or image as input for other custom commands, like I send things to llama.cpp as a prompt. Or even just to have access to things that are on your menu, allowing it to become a bit of a app launcher tool in general.

@end2endzone
Copy link
Owner

If you don't mind me butting in as well, would it be possible to allow SA to pop up a menu inside of something that wasn't Explorer-based?

@Aptronymist, such a feature should be discussed in another issue/thread. Please keep it simple with 1 request/feature per issue.

This issue is for specifically implementing keyboard validation.

end2endzone added a commit that referenced this issue Jan 19, 2024
* Rename `IKeyboardService::IsStateOn()` to `IsToggleStateOn()`.
* Add `Windows` prefix to KeyboardService class.
#138
end2endzone added a commit that referenced this issue Jan 19, 2024
end2endzone added a commit that referenced this issue Jan 19, 2024
* feature-issue138:
  * Fixed issue #138: Restrict the context menu to appear only when the Shift key is held down. #138
  Updated documentation for attribute `keyboard` of Visibility/Validity elements. #138
  Implemented unit tests for attribute `keyboard` of Visibility/Validity elements. #138
  * Move IKeyboardService enums to Enums.h * Rename `IKeyboardService::IsStateOn()` to `IsToggleStateOn()`. * Add `Windows` prefix to KeyboardService class. #138
  Renamed KEYB_TOGGLE_ID enumerations with KTID_ prefix to match their enum name. #138
  Implemented attribute `keyboard` validator parsing. #138
  Created IKeyboardService interface and implemented a win32 KeyboardService. #138
end2endzone added a commit that referenced this issue Jan 20, 2024
…and `keyboard.shift` and updated documentation accordingly. #138
@end2endzone
Copy link
Owner

would it be possible to allow SA to pop up a menu inside of something that wasn't Explorer-based?

@Aptronymist I am sorry but this is not possible with Shell Anything. Shell Anything does not "hack its way" into File Explorer. It is actually the opposite. Shell Anything is a plugin for File Explorer called a Shell Extension. In other words, File Explorer is already designed to allow other software to add dynamic menus.

There is no such plan for Shell Anything to be compatible with other software. That would require deep knowledge of each software and a compatible API / programming language. That would be out of scope for this project.

@end2endzone
Copy link
Owner

@Glavor The feature should be completed in 81cb438. I did not had much time for deep testing but the unit tests says everything should work.

You can get an unofficial 0.9.0 installer from the latest build at https://ci.appveyor.com/project/end2endzone/shellanything/builds/48996052/artifacts or https://github.com/end2endzone/ShellAnything/actions/runs/7595509806/artifacts/1183114765.

Documentation for the feature is in the User Manual, keyboard attribute and live properties section.

If you have time, please check if the feature is working as you expect. Feedback would be much appreciated. I will leave the issue opened for 1-2 weeks.

@Glavor
Copy link
Author

Glavor commented Jan 21, 2024

@end2endzone Thank you for your work. I have conducted a test, and everything is functioning as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants