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
tsenlaw·
  • Guests
  • Last active:
  • Joined: --
First of all, thank you very much Learning one for the great script.

Now, I am using RM together with MGR(Mouse Gesture Recognizer from R3gX). The two scripts improved my work efficiency tremendously.

I have two questions:
(1) Is it possible to call out four different RMs with four directions, i.e. up, down, left and right (the default can only use one direction, for example, down). This way I can use RM as mouse gesture with lots of options.

(2) How can I define the action in RM item only with sending command, such as send ^a, without pre-defining a function or a label.

Thank you again!

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Hi tsenlaw, I'm glad you like it.

Is it possible to call out four different RMs with four directions, i.e. up, down, left and right (the default can only use one direction, for example, down). This way I can use RM as mouse gesture with lots of options.

Yes. Here is similar request - follow steps explained there. As you don't need context sensitivity, in My mouse gestures.ahk, you could for example put something like this;
MG_U() {
   RMApp_MyRMHandler2(56, "c")   ; Shows appropriate menu, gets selected item and executes item action if something was selected. Uses click to select method.
}

MG_R() {
   RMApp_MyRMHandler2(57, "c")   ; Shows appropriate menu, gets selected item and executes item action if something was selected. Uses click to select method.
}

MG_L() {
   RMApp_MyRMHandler2(58, "c")   ; Shows appropriate menu, gets selected item and executes item action if something was selected. Uses click to select method.
}
You could also include [module] Mouse gestures in RM, and than you will be able to call radial menus via gestures with other buttons too - like MButton, XButton1, F1, etc. Study "Example 2 - multiple keys for mouse gestures" in [module] Mouse gestures's comments.

How can I define the action in RM item only with sending command, such as send ^a, without pre-defining a function or a label

You must pre-define function to do that, but it's really very simple. Just put function below in RM\My codes\My functions.ahk
Send(What) {
	Send, %What%
}
and in item action specify Action = fun Send|^a or
Action = fun Send|I can send anything you want...

tsenlaw
  • Members
  • 33 posts
  • Last active: Jan 06 2014 11:59 PM
  • Joined: 26 Aug 2011
Thank you very much for your detailed reply!

As for question 1, I should have been more clear. I mean use RELEASE to select method by one Button like Rbutton in four directions. I think it may be possible by your great coding skill.

Thank you!

bennomoehlman
  • Guests
  • Last active:
  • Joined: --
Hi,
I'm new to Radial Menu, but so far it's awesome!

Is there a way to set one of the items to show the time or the date?
That way I could gain more space on my taskbar by removing it from there. I don't need to always see it.

Thanks

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
@tsenlaw: Currently, this is possible only by modifying internal codes. Maybe I'll implement this as a new feature in future versions... Although I don't like to support modifying RM's internal codes, this time I'll do exception to give you preview how it will work. Presuming your RMShowMethod = D (mouse gesture down) do the following;

Open RM\Internal\Codes\RMApp lib.ahk and go to lines 310-311. There you will find this;
if Gesture = %RMShowMethod%   
break
Replace it with this:
if (Gesture = RMShowMethod)
	break
else if Gesture in R,L,U
{
	Sleep, 30   
	MouseMove, imx1, imy1   
	MGA_%Gesture%()
	return
}
Than open RM\My codes\My mouse gestures.ahk and put this code inside;
MGA_R() {
	RMApp_MyRMHandler2(11, "r", RMApp_Reg("RMShowHotkey"))
}
MGA_L() {
	RMApp_MyRMHandler2(12, "r", RMApp_Reg("RMShowHotkey"))
}
MGA_U() {
	RMApp_MyRMHandler2(13, "r", RMApp_Reg("RMShowHotkey"))
}
Adapt gui numbers (11,12,13) with gui numbers of radial menus you want to call, for example 56,57,58, save changes, reload RM and try it out.

@bennomoehlman: Hi bennomoehlman, I'm glad you like it. Currently, this would only be possible by modifying internal codes, but it would be complicated, so consider that the answer for now is: "currently no". One of ideas was to display time and date in the center of menu - instead of default "RM4" text. Maybe I'll implement this as a new feature in future versions...

Also, one of my ideas is to display other info around radial menu - like CPU usage, RAM usage, time & date, weather, and other little widgets... If you watched IronMan movie, something like Iron Man HUD... But I consider all of that as "not functional make-up" so it has very low priority.

serenityjazz
  • Guests
  • Last active:
  • Joined: --
Hi all,

I 've just discovered this awesome program wich seems to responding exactely what i need..
But after few minutes of try i've one question about the navigator's behavior:
My idea is to build a submenu to have a toolbar that control vlc player. So i think i have to write a script who just send keystroke then "put it in the RM". Here is my problem cause when i will click and call play/pause script i don't want that the radial menu come to disappear..!? cause i would like to be able to "repress" the button or increase or decrease the sound volume by clicking few times on Vol + without the disappearing menu...
Is there is any way to solve my problem ?

Ps: forgive my little english

tsenlaw
  • Members
  • 33 posts
  • Last active: Jan 06 2014 11:59 PM
  • Joined: 26 Aug 2011

Although I don't like to support modifying RM's internal codes, this time I'll do exception to give you preview how it will work


That works perfectly. Thank you very much for giving me the exception!

Besides, could you please tell me how can I change another RM menu in another direction like left direction to 8-16 items-layout-Per-Ring while keeping the default down direction as 6-12 layout? Further, is it possible to change the layout per ring in RMD?

Amiri
  • Guests
  • Last active:
  • Joined: --
1. Why doesn't the latest Radial menu work properly with AutoHotkey_L x64 v1.1.05.01?

2. Why does it create 5 proccesses instead of only one?


Got Win7 x64. Thanks.

gemisigo
  • Members
  • 94 posts
  • Last active: Apr 02 2015 02:36 PM
  • Joined: 10 Sep 2010
Weird things happen after restoring windows (win 7 pro) from hibernation. The mouse gesture for summoning main menu still works, the menu is functional but it is not visible. Menu items can be selected because the tooltip is shown and sound effects are audible. I'm not sure it happens every time but I've seen several times.

I guess it's windows related and does not have anything to do with AHK. Any ideas?

qerenityjazz
  • Guests
  • Last active:
  • Joined: --
In other words is it possible to close RM/submenus only when i click the central item ? and NOT close when you click all other items... Like this we can launch few items without call again RM and SubRM ?

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
@serenityjazz: Hi serenityjazz, I'm glad you like it. Download RM2module.rar and try Example 5 - Toolbar.ahk Would you like to have something like that? Of course, instead of showing selected item number in message box, it would send commands to vlc player. Or maybe you would like to have something that looks like this:
Gui 1:Font, q5
Gui 1:-Caption +ToolWindow +AlwaysOnTop
Gui 1:Add, Button, x2 y2 w40 h40, Stop
Gui 1:Add, Button, x42 y2 w40 h40, Prev
Gui 1:Add, Button, x82 y2 w80 h40, Play/Pause
Gui 1:Add, Button, x162 y2 w40 h40, Next
Gui 1:Add, Button, x202 y2 w40 h40, Vol+
Gui 1:Add, Button, x242 y2 w40 h40, Vol-
Gui 1:Show, w284 h44
return
You could replace buttons with pictures/icons to make it look better.

Regarding changing volume, here's a really useful code;
#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}
#If

MouseIsOver(WinTitle) {
    MouseGetPos,,, Win
    return WinExist(WinTitle . " ahk_id " . Win)
}
It allows you to change volume just by scrolling your mouse wheel over taskbar. Simple as that.

Currently there is no setting that will prevent RM to hide its menu(s) after you select item. It can be done only by modifying RM's internal codes - which I don't recommend. Or you could use [module] RM2module, which is the main engine of RM4, and build your own application with radial menus that will act exactly as you wish.

Although you can currently launch only 1 item before RM auto-hides, you could make 1 item to do multiple tasks. For example, by selectiong only 1 item, you could run Notepad, run Calculator, and open My Documents folder at the same time. Just put this function in RM\My codes\My functions.ahk
MultiTask() {
	Run, %A_WinDir%\notepad.exe
	Run, %A_WinDir%\system32\calc.exe
	Run, %A_MyDocuments%
}
and in Item action specify Action = fun MultiTask.

Hey, one more thing, if you are new not only to RM, but to AutoHotkey too, take it easy. If you don't understand codes above, that's perfectly normal. It takes time to learn...


@tsenlaw: There is only one Item-Layout-Per-Ring per script possible. So, in one script, you can't have for example 8.14.20.26 layout for few menus, and 6.12.18.24 for all other menus. That is not going to change probably until RM3module (if I'll ever make it). All of above applies only on multi-ring menus and you probably know that in one script, you can have both multi-ring and one-ring menus, no problem. Layout in one-ring menus mainly depends on number of items in menu. For details, see documentation in RM2module.ahk's comments.

Workaround for different Item-Layout-Per-Ring for multi-ring menus would be to create 2 (or more) scripts, each having their own Item-Layout-Per-Ring, and enable inter-script communication between them via SendMessage - OnMessage() combination.

RMD can display different Item-Layout-Per-Rings, because I tried to make it RM3module compatible. Look in comments in RM\Internal\Codes\RMD.ahk. Uncomment hotkeys
F6::App.SetLayout("9")				; one ringer with 9 items
F7::App.SetLayout("15")				; one ringer with 15 items
F8::App.SetLayout("8_14_20")		; multi ringer
F9::App.SetLayout("6_12_18_24")		; multi ringer
and press them to change layout. If you want to have different layout from RMD startup, specify it before creating RMD application object; for example, put this
Layout := {ItemLayout: "8_14_20_26"}
one line above
App := new c_App(MenuOptions, MenuVariables, Miscellaneous, Layout, GuiOptions, ItemBitmapOptions)	; creates application object (RMD)

@Amiri:

Why doesn't the latest Radial menu work properly with AutoHotkey_L x64 v1.1.05.01?

RM does not work with AutoHotkey_L x64 mainly because Tic's GDI+ library is not compatible with it. When he will make it compatible with both x86 x64, than I'll probably make RM compatible with both x86 x64. So for now, RM works only with AutoHotkey_L x86 Unicode, and you can run it on x64 computer without problems. And btw, although RM uses x86, you can launch some (or all) of your scripts via RM with x64 version of AHK_L (or any other version) without problem - use custom functions.

Why does it create 5 proccesses instead of only one?

I wanted to have sound-mixing enabled in RM. Here's how it could be done;
[*:1dpvthuj]by using real multi-threading. Unfortunately, nor AutoHotkey_L neither AutoHotkey Basic don't support it
[*:1dpvthuj]by using AutoHotkey.dll - it supports real multi-threading. Unfortunately, there are some legal problems which don't allow RM to use AutoHotkey.dll
[*:1dpvthuj]by using some other dlls. Unfortunately, there are some legal problems + they are mainly not for free.
[*:1dpvthuj]by creating temporary ahk script, running it, and deleting it. Unfortunately, delay between the moment when such script should play sound and moment it actually plays it is too big
[*:1dpvthuj]by using multi-processing. Well, that's only left. Therefore I made 1 main script, and 4 assistant scripts whose only task is to play sounds when main script sends them a messagge. On RM main script start-up, it starts 4 assistant scripts, and on RM main script exit, it closes them all. That's the reason you have 5 proccesses instead of one. However, this can be disabled in General settings.txt; if you specify RunSoundPlayers = 0, than RM will not run those 4 assistant scripts. In that case, RM will consume less RAM, there will be only one Radial menu.exe proccess, but you will hear no sounds (no matter if Sounds = 1), and all "sounds on methods" will not have effect.
@gemisigo:I really have no idea why is this happening (+ you already know I don't have opportunity to test RM on Win 7, yet). I put my PC (Win XP) on hibernation while RM was running probably more than 1000 times, and never had problems after restoring. So it looks there are some problems with displaying layered windows on Win 7 after restoring from hibernation...

Run test script below (you'll have to include Gdip.ahk by Tic) with same privileges as when you run RM. Press F1 to show/hide that semi-transparent blue circle. It should work normally. Than go to hibernation while keeping script running. After restoring from hibernation, press F1 again to show/hide circle. Can you make it visible again or show/hide doesn't work any more?
;===Auto-execute========================================================================
Width := 300, Height := 300
Gui 1: -Caption +E0x80000 +LastFound +ToolWindow +AlwaysOnTop +OwnDialogs
Gui 1: Show, NA
hwnd := WinExist()

pToken := Gdip_Startup()
hbm := CreateDIBSection(Width, Height), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc), Gdip_SetSmoothingMode(G, 4), Gdip_SetInterpolationMode(G, 7)

pBrush := Gdip_CreateLineBrushFromRect(0, 0, Width, Height, 0xee5555ff, 0x555555ff)
Gdip_FillEllipse(G, pBrush, 0, 0, Width-1, Height-1)
Gdip_DeleteBrush(pBrush)

UpdateLayeredWindow(hwnd, hdc, (A_ScreenWidth-Width)/2, (A_ScreenHeight-Height)/2, Width, Height)
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc), Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
Return

;===Hotkeys=============================================================================
F1::
if DllCall("IsWindowVisible", "Ptr", hwnd)
	Gui 1: Hide
else
	Gui 1: Show, NA
return

Esc::ExitApp

;===Functions===========================================================================
#Include Gdip.ahk ; by Tic.	http://www.autohotkey.com/forum/viewtopic.php?t=32238


  • Guests
  • Last active:
  • Joined: --
Hello, the mouse gesture is now in four-basic-directions mode, can it be changed to 8 basic directions? Thanks!

Amiri
  • Guests
  • Last active:
  • Joined: --
Thanks for your reply.

I've found fincs' x64 version of GDI+ 1.44: https://ahknet.autoh...64/Gdip_new.ahk

Works great with AutoHotkey_L x64 so far.

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

I really have no idea why is this happening (+ you already know I don't have opportunity to test RM on Win 7, yet). I put my PC (Win XP) on hibernation while RM was running probably more than 1000 times, and never had problems after restoring. So it looks there are some problems with displaying layered windows on Win 7 after restoring from hibernation...

Run test script below (you'll have to include Gdip.ahk by Tic) with same privileges as when you run RM. Press F1 to show/hide that semi-transparent blue circle. It should work normally. Than go to hibernation while keeping script running. After restoring from hibernation, press F1 again to show/hide circle. Can you make it visible again or show/hide doesn't work any more?

Yes, I know, and I appreciate that you try to help in spite of not being able to test. My question was meant to anyone possibly having the same problem. I'm now certain it does not happen every time, since it did not happen the last three times. I could show/hide blue circle as well. It's not annoying, it's simply strange.

Regarding mouse gestures, I think the number of possible variations is high enough already and introducing diagonals (not to mention custom gestures) would make it more sensitive to user "shakiness". I'm against it (if my opinion counts, of course).

tsenlaw
  • Members
  • 33 posts
  • Last active: Jan 06 2014 11:59 PM
  • Joined: 26 Aug 2011
Thank you for your reply, Learning one!

Regarding gestures, is it possible to make it optional with 8 basic directions, like Lex' Mouse Gestures do?