Global keyboard shortcut to restore XYplorer from tray

Features wanted...
a1l0s2k9
Posts: 47
Joined: 31 Dec 2008 00:09

Global keyboard shortcut to restore XYplorer from tray

Post by a1l0s2k9 »

My wish
I wish for the ability to assign a keyboard shortcut in XYplorer that will restore my XYplorer window that I have minimized to the tray.

Background
For programs that I use very frequently I prefer to keep them open all the time. Additionally, I prefer to minimize them to the tray because there always running, so there's no value (to me) in showing them in the taskbar. This arrangement means that my taskbar only shows the programs I'm working on at the moment, which is great for me. In addition to XYplorer, other programs I use in this same way include X1, MediaMonkey, WinAmp, VirtuaWin, and Dexpot. All of these programs (except XYplorer) have the option of providing keyboard shortcuts that are truly global (they work regardless of which application is in focus), and this allows me to access these applications that normally live in the tray without having to use the mouse. It would be nice if XYplorer, too, had such a functionality.

Workaround
To workaround this need I've configured XYplorer to only allow a single instance, and I've modified a shortcut on my desktop to XYplorer to have a "Shortcut key". The net effect is that when I press "Ctrl + Alt + Y" explorer.exe runs "C:\Program Files (x86)\XYplorer\XYplorer.exe", which detects that it's configured to only allow one instance and that another instance is already running, so it brings the existing XYplorer window into focus.

Final comments
I have a workaround, though it's not ideal for three main reasons:
  • It requires that I disable multi-window mode (this makes XYplorer a tad harder to use as an explorer.exe replacement, at least until the dual-pane functionality is built).
  • It's not as easily portable to other systems as I'd like -- if XYplorer was configured to have a global shortcut, and it could automatically register itself the first time it was run, this would make it easier to transport my XYplorer configuration to other systems (i.e. eliminate the requirement that I create a windows shortcut and configure the keybinding there).
  • It requires that my shell be explorer.exe, or a shell with functionality to bind keyboard shortcuts to start applications
Not the end of the world of course, just a nice-to-have. :) Thanks in advance for considering it!

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by jacky »

I think this has been wished/discussed before, but has been turned down because XY is portable and this would require to mess with the registry.

(Unless what you're looking for is only a shortcut to restore an already running instance (i.e. not start a new one), and there's a possibility to do that without messing with the registry or anything, but I'm not sure that can be done -- or that Don would go for it.)
Proud XYplorer Fanatic

avsfan
Posts: 554
Joined: 29 Jun 2006 09:00
Location: Fort Collins, Colorado

Re: Global keyboard shortcut to restore XYplorer from tray

Post by avsfan »

I'm not an AutoHotKey wizard (but do use it occasionally -- actually, I only used it for updating XY before jacky's great scripts came along...), but this seems like something that AHK could do very well (and still keep the portability of XY...)

Or am I missing something? (other than it requires running an additional app...)

a1l0s2k9
Posts: 47
Joined: 31 Dec 2008 00:09

Re: Global keyboard shortcut to restore XYplorer from tray

Post by a1l0s2k9 »

Or am I missing something? (other than it requires running an additional app...)
No you're not missing anything. :) I'm a bit of an AutoIt wizard myself, so I know for sure it would be trivial to create an AutoIt script to do this. The problem is that it requires having another program running, which is arguably worse than relying on explorer.exe like I am now.
I think this has been wished/discussed before, but has been turned down because XY is portable and this would require to mess with the registry.
Then firstly, I should apologize...I did indeed search the forums but I guess my powers of search failed me. Sorry about that.

Regarding the portability, it's not clear to me why you'd have to modify the registry. I'm talking about a hotkey that restores into the foreground an already-running instance of XYplorer. I believe this would be as simple as calling RegisterHotKey() and adding a message handler in XYplorer for the WM_HOTKEY event that simply restores (un-minimize) the window.

However, even if it did require modifying the registry I still don't see that as a problem, so long as the feature is optional and disabled by default. Agree/disagree?

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by jacky »

a1l0s2k9 wrote:Regarding the portability, it's not clear to me why you'd have to modify the registry. I'm talking about a hotkey that restores into the foreground an already-running instance of XYplorer. I believe this would be as simple as calling RegisterHotKey() and adding a message handler in XYplorer for the WM_HOTKEY event that simply restores (un-minimize) the window.
Yes, might be that the request had been for a global KS to even start a (first) instance of XY, which might then required to mess with Windows/registry. If it can be done without that, maybe there's a chance...
a1l0s2k9 wrote:However, even if it did require modifying the registry I still don't see that as a problem, so long as the feature is optional and disabled by default. Agree/disagree?
I think it's just a common rule that XY never messes with your system, not adding files (outside of its app/data/thumbs folders) nor modifying the registry in any ways, and Don likes to keep it that way. The only exception IIRC being on ConfigAdvanced: XY in shell ctxt menu. That's why you don't find an option to make XY the default file manager/associated with drives/folders...
Proud XYplorer Fanatic

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Global keyboard shortcut to restore XYplorer from tray

Post by PeterH »

a1l0s2k9 wrote:However, even if it did require modifying the registry I still don't see that as a problem, so long as the feature is optional and disabled by default. Agree/disagree?
I really agree with this!
I think it's good that XY basically doesn't use registry. But if there's a function that can be useful, I think it should be supplied with XY and callable by user *at wish*.

Just my point of view.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by admin »

OK, looks like RegisterHotKey() does indeed work without altering the system permanently. But anyway, I don't want to put too much effort into this. So spare me the research and answer this: How is the configuration for such a hot key usually done? = Where/How does the user define WHICH key does WHAT?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Global keyboard shortcut to restore XYplorer from tray

Post by TheQwerty »

I posted the AHK script for this long ago...
http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=2682

The Win+E hotkey should still work perfectly. I have an updated version at work that I've been meaning to upload, but it doesn't change that part of the code at all.

a1l0s2k9
Posts: 47
Joined: 31 Dec 2008 00:09

Re: Global keyboard shortcut to restore XYplorer from tray

Post by a1l0s2k9 »

Where/How does the user define WHICH key does WHAT
X1 does it by having a single configuration option that specifies the keyboard shortcut to restore the window. This is the only X1 hotkey that's global (i.e. this one hotkey is treated separately from all others), like this:
Image

MediaMonkey does it by allowing any hotkey to be "global", based on a checkbox next to each keybinding, like this:
Image

Either approach would work for me. Allowing any hotkeys to be global is clearly more flexible, but it's probably more work. If UDC's could be global, though, it might be handy for:
  • Running a common report (no need to focus XYplorer first)
  • Opening a common location (again, no need to focusing XYplorer first)
I believe either would address my wish nicely. :)

a1l0s2k9

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by admin »

a1l0s2k9 wrote:
Where/How does the user define WHICH key does WHAT
X1 does it by having a single configuration option that specifies the keyboard shortcut to restore the window. This is the only X1 hotkey that's global (i.e. this one hotkey is treated separately from all others), like this:
Image

MediaMonkey does it by allowing any hotkey to be "global", based on a checkbox next to each keybinding, like this:
Image

Either approach would work for me. Allowing any hotkeys to be global is clearly more flexible, but it's probably more work. If UDC's could be global, though, it might be handy for:
  • Running a common report (no need to focus XYplorer first)
  • Opening a common location (again, no need to focusing XYplorer first)
I believe either would address my wish nicely. :)

a1l0s2k9
Okay, thanks! I put it on my list, though it will not get a high prio.

Question: What happens if two apps register the same hotkey?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Global keyboard shortcut to restore XYplorer from tray

Post by TheQwerty »

admin wrote:Question: What happens if two apps register the same hotkey?
According to MSDN:
RegisterHotKey fails if the keystrokes specified for the hot key have already been registered by another hot key.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by admin »

TheQwerty wrote:
admin wrote:Question: What happens if two apps register the same hotkey?
According to MSDN:
RegisterHotKey fails if the keystrokes specified for the hot key have already been registered by another hot key.
Thanks.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by admin »

Okay, I added it and I must say I like it. :) On my system now, Win+X will restore/foreground XY.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Global keyboard shortcut to restore XYplorer from tray

Post by j_c_hallgren »

Is there some way to detrmine which "Win+" keys are already in use? It would appear that Win+X is free from your usage, but just made me wonder.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Global keyboard shortcut to restore XYplorer from tray

Post by serendipity »

admin wrote:Okay, I added it and I must say I like it. :) On my system now, Win+X will restore/foreground XY.
I like it too :) . I had to use Win+Z because my Win+X is bound to something else, but I dont care.

Post Reply