Is it possible to create keyboard shortcuts that are only active for specific drives or folders? Some people may refer to this as context-sensitive shortcuts. For example, if I'm using Microsoft OneDrive and I push the 'delete' key, the function would be remapped to "Remove Shortcut". However, if I'm using any other drive/folder the 'delete' key should function as normally intended. How can I set up context-sensitive keyboard shortcuts?
Screenshot of OneDrive highlighting the ''remove shortcut" option.
Setting Up Context-Sensitive Keyboard Shortcuts
Re: Setting Up Context-Sensitive Keyboard Shortcuts
You can't. If you want something like this, do in via e.g. AutoHotkey...
One of my scripts helped you out? Please donate via Paypal
Re: Setting Up Context-Sensitive Keyboard Shortcuts
I'm surprised that 'you can't'. I really would've thought that a script may be able to do something like this...
Delete Key -> check if the selected file is in a specific folder and is a shortcut -> if True Remove Shortcut -> if False delete file.
Re: Setting Up Context-Sensitive Keyboard Shortcuts
You can't assign the delete key to execute a specific script...
One of my scripts helped you out? Please donate via Paypal
Re: Setting Up Context-Sensitive Keyboard Shortcuts
Eh, sorry highend, but you can! ("Customize kbd shortcuts" supports the Del key and the assignment is effective afterwards!)
Last edited by MBaas on 19 Apr 2024 17:55, edited 1 time in total.
______________________________________________
Happy user ;-)
Happy user ;-)
Re: Setting Up Context-Sensitive Keyboard Shortcuts
Oh, you're right. You can't do this directly in the user defined commands but via keyboard shortcuts...
One of my scripts helped you out? Please donate via Paypal
Re: Setting Up Context-Sensitive Keyboard Shortcuts
So I guess the answer to the op's question is then that this functionality would be achievable with scripting.
You could easily set up a script that would check if "<curpath>default_action.xys" existed and then execute it.
Although...I personally do not like that idea - far too much to set this up, especially when you repeatedly want to run existing scripts in other folders.
Maybe if one would tag the folders and ran tag-specific macros.
You could easily set up a script that would check if "<curpath>default_action.xys" existed and then execute it.
Although...I personally do not like that idea - far too much to set this up, especially when you repeatedly want to run existing scripts in other folders.
Maybe if one would tag the folders and ran tag-specific macros.
______________________________________________
Happy user ;-)
Happy user ;-)
Re: Setting Up Context-Sensitive Keyboard Shortcuts
Yes you can via scripting, just need to check the location before actually making an action Here 's an example of script i use for delete with better safe belts, that has different action when location is a paper folder.SirSocks wrote: ↑19 Apr 2024 15:45 Is it possible to create keyboard shortcuts that are only active for specific drives or folders? Some people may refer to this as context-sensitive shortcuts. For example, if I'm using Microsoft OneDrive and I push the 'delete' key, the function would be remapped to "Remove Shortcut". However, if I'm using any other drive/folder the 'delete' key should function as normally intended. How can I set up context-sensitive keyboard shortcuts?
Win 7 SP1 x64 100% 1366x768