terrypin Posted March 18, 2010 Report Share Posted March 18, 2010 This one has me struggling. First a little background. The environment is map applications like Memory Map, Google Earth, etc. I sometimes hover the mouse cursor on the map and then with a memorised hotkey activate a macro which does something concerning that position. Such as place a visible marker at that place, or copy its co-ordinates to the clipboard, etc. However, because there are many of these macros and I sometimes forget their hotkeys, I also want to include the macros in a pop-up menu. My preferred method of activating a menu involves middle-clicking the application window title bar. So this inevitably alters the macro, because at the very least I want to display instructions at its start like "Place the mouse cursor at the required position before continuing." Now, I could of course create two separate macros in every case, one for immediate hotkey use, the other for use via the menu. But I'm sure it ought to be possible to accomplish this more elegantly with a single macro, which initially somehow detects whether it's been started from a menu. But how? My first thought was to detect the topmost window title. But of course that doesn't work because a pop-up menu immediately closes when one of its macros is started! Another possibility would be to change the menu activation to a middle click anywhere on the map, rather than restricting it to the title bar. Providing I then activated the macro by its accelerator key rather than impulsively d-clicking it, that would then leave the mouse cursor in the target position. But I suspect I'm missing some obvious smart solution that doesn't require such a major change. Any ideas please? Edit: I've thought of a solution that I'll try shortly. I'll amend the main menu to include code that writes a switch value ON to the registry. Then in the individual macros under discussion add code at their start to read and test that value, continuing as appropriate. And then switch it OFF. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.