Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RADIAL MENU scripts - migrated to new forum


  • Please log in to reply
1310 replies to this topic
Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

creating a script that will force RM to reload after exiting from hibernation

Unfortunately, I don't know how to make a script which will notify me when computer is resuming from a hibernation. I tried TheGood's Wrapper to catch Power Management events but I can't catch resuming from hibernation event on my Win7. sad.png

 

If somebody will give me ready to use the code which will notify me when computer is resuming from a hibernation, and which will work on WinXP, Win Vista, Win 7 and Win 8, I'll be very motivated to develop Redraw function in RM2module, which will redraw all radial menus and docks.

 

To learn how to send messages to RM4, open RM4\Utilities\RM messages tester.ahk. For example, to send message to RM4 to reload itself from another script/process, you'll need this;

F1::PostMessage("Radial menu - message receiver",02)	; reload RM4

PostMessage(Receiver,Message) {
	oldTMM := A_TitleMatchMode, oldDHW := A_DetectHiddenWindows
	SetTitleMatchMode, 3
	DetectHiddenWindows, on
	PostMessage, 0x1001,%Message%,,,%Receiver% ahk_class AutoHotkeyGUI
	SetTitleMatchMode, %oldTMM%
	DetectHiddenWindows, %oldDHW%
}  

Sending a message to RM4 from another script/process which tells RM4 to show specific menu in click to select mode, or to change profile is not implemented yet (but it can be done). If you are developing your own app with radial menus, see examples in RM2module.


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


tester4
  • Members
  • 6 posts
  • Last active:
  • Joined: 07 Apr 2013

Hi,

 

I was thinking about other methods (all of them require to have some way to run a command that reloads RM, "chosen reload method" = /reload parameter or other script that reloads RM):

1) new scheduler task that will run a "chosen reload method" after exiting from hibernation,

2) new scheduler task that will run a "chosen reload method" after the user has logged in,

3) own service installed in windows that will run a "chosen reload method" after exiting from hibernation.

 

I wrote a simple script that reloads RM:

 

taskkill /F /IM "Radial menu.exe"

"Radial menu.exe"

 

Unfortunatelly, it leaves an icon on the taskbar, so when you run such script you'll be left with an old RM icon until you hover a mouse on it (not perfect solution, but works! I know that someone who knows how to develop in autohotkey will make a better script for reloading).

 

Then, I made it working wink.png   - as a trigger in task properties I set 'On workstation unlock' - of course it leaves an additonal icon as mentioned before.



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

Why are you forcefully killing a process? Simple .ahk script which "peacefully" tells RM4 to reload when you press F1 is in my post above.
You just have to remove F1:: if you want to tell RM4 to reload when you run that script (automatically, without pressing F1). Like this;

PostMessage("Radial menu - message receiver",02)	; reload RM4

PostMessage(Receiver,Message) {
	oldTMM := A_TitleMatchMode, oldDHW := A_DetectHiddenWindows
	SetTitleMatchMode, 3
	DetectHiddenWindows, on
	PostMessage, 0x1001,%Message%,,,%Receiver% ahk_class AutoHotkeyGUI
	SetTitleMatchMode, %oldTMM%
	DetectHiddenWindows, %oldDHW%
}

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


gemisigo
  • Members
  • 94 posts
  • Last active: Apr 02 2015 02:36 PM
  • Joined: 10 Sep 2010

Occasionally I get the

Could not close the previous instance of this script. Keep waiting?

dialog when I try to reload RM. Is there a way to "auto-wait" or something?



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

I'm not sure. Maybe I'll say complete nonsense, but there are 2 things which may be relevant;
1) There is #SingleInstance, ignore line in RM\Internal\Codes\RMApp lib.ahk. Maybe it should be changed to #SingleInstance, force? This probably isn't important because AHK says that both force and ignore parameters skip the dialog box. But does #SingleInstance command actually matter when Reload command is used? Probably not (?)
2) There is a Sleep, 100 line in the end of body of RMApp_OnExit() function located in RM\Internal\Codes\RMApp lib.ahk. Maybe it should be deleted because it's causing to long wait? I don't think so but who knows...


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


gemisigo
  • Members
  • 94 posts
  • Last active: Apr 02 2015 02:36 PM
  • Joined: 10 Sep 2010

It does not always happen. Restarting immediately after restarting happy.png almost always works. It requires using it a while for a restart to trigger that dialog. I had many different scripts in AHK before RM and I slowly merged most of them into RM over the last few years. I think those might get in the way as well. I'm not sure #1 could help here, it's not a new instance that's started over the old one but the old one is/should be shut down prior starting the new on. Providing that I understand the concept of reloading a script properly, of course.

I'll try to remove the Sleep line you mentioned in #2 to see if it works. By the way, what's the reason for that line?

EDIT: it did not help :( I'll restore it.



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

This is how RMApp_OnExit() looks in my private RM v4.3502 (not released yet)

RMApp_OnExit() {
	RunSoundPlayers := RMApp_Reg("RunSoundPlayers")
	if (RunSoundPlayers = 1) {	; SoundPlayers scripts were run
		;===Close SoundPlayers===
		RMApp_PostMessage("RMSoundOnShow",3)
		RMApp_PostMessage("RMSoundOnSubShow",3)
		RMApp_PostMessage("RMSoundOnSubHide",3)
		RMApp_PostMessage("RMSoundOnHover",3)
		If (A_ExitReason = "Reload" or A_ExitReason = "Single")
			Sleep, 100	; give some time to SoundPlayers to close
	}
}

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


gemisigo
  • Members
  • 94 posts
  • Last active: Apr 02 2015 02:36 PM
  • Joined: 10 Sep 2010

I see. Nevertheless, the problem lies elsewhere. I'm going to revise and restructure the codes I added to RM, they made the whole shebang quite messy :) I hope to fix that error too.

 

By the way, any hints on release date/fixes/features? 



tester4
  • Members
  • 6 posts
  • Last active:
  • Joined: 07 Apr 2013

Hi,

 

I've discovered two bugs that only happen when RM is run in multi-monitor environment.

Let's assume we have two monitors: default monitor = monitor #1 (on the left), second monitor = monitor #2 (on the right)

 

1) When you draw a RM gesture on the second monitor, RM is drawn correctly on the second monitor, but the action's text is aligned to the right edge of the default monitor (it should be displayed with RM on the same monitor).

 

2) When RM is displayed on the second monitor and you execute chosen action, the action is executed on the default moniotor (I was expecting the action to be started on the same monitor as RM is displayed on).



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

By the way, any hints on release date/fixes/features?

Here is what I have done so far and what I plan to do before next public release:
RM4
- added: LastUsedSubmenu
- added: more info in hidden "Radial menu - message receiver" window - allows any app/procces to get some basic info about currently runing RM4 and AutoHotkey which interprets it.
- planned: add 3 more events: OnSelectItem, OnReceiveMessage, OnPostMessage
- planned: maybe do somtehing with "portable wishes" ...?; link1, link2

RMD
- added AfterDropFileOnBoard event
- planned: add "SetLayout..." item and dialog in view menu. Although It's all explained in RMD.ahk's comments, it seems that very few people know that SetLayout() method is already available for more than a 2 years! shocked.png
 
RM2module
- planned: add Redraw() function
 

... multi-monitor environment ...

Unfortunately, I have no experience with multi-monits. sad.png
 

...RM is drawn correctly on the second monitor, but the action's text is aligned to the right edge of the default monitor

If you mean ToolTip, see this post. RM2module, and therefore RM4 too, use that ToolTipFM() function. On 07.05.2011. two users (musketball and me lance) tested it on multi-monitors and they reported that it works fine. Could you test it too? As I said, I have no experience with multi-monits, never had opportunity to work on them, so I can't do tests myself. I can only relay on what others say... sad.png
 

When RM is displayed on the second monitor and you execute chosen action, the action is executed on the default moniotor

Do this simple test; switch to second monitor, run this script

F1::Run, notepad

, and press F1. Where will action be executed? (where will notepad window be displayed)? On default or second monitor?


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


tester4
  • Members
  • 6 posts
  • Last active:
  • Joined: 07 Apr 2013

Unfortunately, I have no experience with multi-monits. sad.png
 

If you mean ToolTip, see this post. RM2module, and therefore RM4 too, use that ToolTipFM() function. On 07.05.2011. two users (musketball and me lance) tested it on multi-monitors and they reported that it works fine. Could you test it too? As I said, I have no experience with multi-monits, never had opportunity to work on them, so I can't do tests myself. I can only relay on what others say... sad.png
 

Do this simple test; switch to second monitor, run this script

F1::Run, notepad

, and press F1. Where will action be executed? (where will notepad window be displayed)? On default or second monitor?

 

1) tested ToolTipFM

genereally works OK, but:

F1 - flickers very much, F2 - works well, F3 - flickers, F4 - works, but after some time the whole multiline text is shortened to one line then it comes back to multiline (strange behaviour sad.png )

 

2) unfortunately, notepad is always run on default (1st monitor); probably it's not such easy to have multiple monitor support wink.png



loumizhu
  • Members
  • 21 posts
  • Last active: Oct 25 2019 04:53 AM
  • Joined: 02 Oct 2012

Edit: i got a little problem using docks , but now it's solved. nevermind !

 

does docks always make your current app lose focus ?

coz i wanted to send it a shortcut

and using winactivate makes it a bit laggy

 

thanks



Wickster
  • Members
  • 97 posts
  • Last active: Jun 03 2019 03:24 AM
  • Joined: 12 Jan 2013

was trying to get a game to work with this like all my other games i just followed the tutorial, however with this game its different

 

 

2Llof.png

 

 

"C:\Program Files (x86)\Hi-Rez Studios\HiRezLauncherUI.exe" game=300 product=17

 

 

 

is the target and when i click open file location it takes me to this

 

2Llq5.png

 

 

however if i try to just click " HiRezLauncherUI.exe " it gives me this error

 

2Llrg.png

 

but it works from the desktop icon, so im thinking game=300 product=17 has something to do with it, my question is how do i get Radial Menu to recognize it ?



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

@tester4: If you could improve that ToolTipFM function, do it and post it here and I'll implement it in RM2module and RM4.
You cold also ask in Ask for help forum what you can do to run a program on active (not default) monitor (for example: F1::Run, notepad). Post solution here and I'll see what I can do.

@loumizhu: I guess you tried Example 4 - Docks.ahk from RM2module. Forget that. That example is made for AHK Basic compatibility. Try Example 4b AHK_L - Docks.ahk. It uses #If context sensitive hotkey and your app won't lose focus when you click on dock.
Related: you might be interested in Example 9 AHK_L - Menu definition in RMApp style.ahk too - you can build and edit your menu in Radial menu designer, save it and use as dock's menu.

@Wickster: run the script below and tell me which hotkey will run your game

F1::Run, C:\Program Files (x86)\Hi-Rez Studios\HiRezLauncherUI.exe "game=300 product=17"
F2::Run, HiRezLauncherUI.exe "game=300 product=17", C:\Program Files (x86)\Hi-Rez Studios
F3::Run, "C:\Program Files (x86)\Hi-Rez Studios\HiRezLauncherUI.exe" game=300 product=17

; if none of above work, experiment yourself and post me the working code...

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Wickster
  • Members
  • 97 posts
  • Last active: Jun 03 2019 03:24 AM
  • Joined: 12 Jan 2013

Thanks for the fast response and I made a new script on my desktop and did the code you suggested, f1 and f2 didnt work but f3 worked just fine, i put the code in RM and tried to run it and this is what it gives me

 

 

2MgFi.png

 

not sure what that means, and i suppose i could just hotkey it in RM and have another script for it but i really dont wanna do that :/