Setting Up Context-Sensitive Keyboard Shortcuts

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
SirSocks
Posts: 8
Joined: 14 Apr 2022 14:24

Setting Up Context-Sensitive Keyboard Shortcuts

Post by SirSocks »

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.
Image

highend
Posts: 13357
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by highend »

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

SirSocks
Posts: 8
Joined: 14 Apr 2022 14:24

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by SirSocks »

highend wrote: 19 Apr 2024 15:53 You can't. If you want something like this, do in via e.g. AutoHotkey...
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.

highend
Posts: 13357
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by highend »

You can't assign the delete key to execute a specific script...
One of my scripts helped you out? Please donate via Paypal

SirSocks
Posts: 8
Joined: 14 Apr 2022 14:24

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by SirSocks »

highend wrote: 19 Apr 2024 16:12 You can't assign the delete key to execute a specific script...
Ah, thank you for clarifying :)

MBaas
Posts: 582
Joined: 15 Feb 2016 21:08

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by MBaas »

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 ;-)

highend
Posts: 13357
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by highend »

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

MBaas
Posts: 582
Joined: 15 Feb 2016 21:08

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by MBaas »

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.
______________________________________________
Happy user ;-)

eil
Posts: 1627
Joined: 13 Jan 2011 19:44

Re: Setting Up Context-Sensitive Keyboard Shortcuts

Post by eil »

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?
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.
Win 7 SP1 x64 100% 1366x768

Post Reply