Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Middle click to move to secondary editor
#1
I'd like to be able to middle click a macro in the "Open Items" list to move it to the secondary editor.
I was looking for a way to do a 'middle-click' event on win("Open items" "SysTreeView32" "qm") and do a 'men' command but the recorder can't pull up the menu number and the best I could do for the mouse click was a filter function but it still closes the macro rather than performing the macro.

is it possible to re-map that function?

thanks.
An old blog on QM coding and automation.

The Macro Hook
#2
My suggestion - use double right click trigger

Macro
Trigger ##Rh1 0x9 /QM /FF_qm_mouse_is_on_open_items     Help - how to add the trigger to the macro
Code:
Copy      Help
wait 1 -WC "+#32768" ;;wait for first menu destroyed
wait 1 WV "+#32768" ;;wait for next menu
key r ;;Move to Right
err+

Function FF_qm_mouse_is_on_open_items
Code:
Copy      Help
;/
function# iid FILTER&f

if(!f.hwnd2) ret
if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid

----------

Middle click with filter function should not close item if Eat checked.

Menu id is
Code:
Copy      Help
men 33293 id(2213 _hwndqm) ;;Move to Right

It can be recorded from menubar. It moves current item, not item from mouse. You would have to lef at first.
#3
wow...i'm having terrible luck with this.
neither is working for me.

i created a macro with that trigger and a new filter function with that code but when i double-right-click nothing happens. i even added a quick "out" to see if the ff was even getting triggered but nothing doin.


on the middle click i tried it with 'eat' checked with 'when released' both checked and unchecked and it failed as well. is there something weird that i'm overlooking here? :?:
An old blog on QM coding and automation.

The Macro Hook
#4
In Properties of FF, must be checked 'this function is FF'.

Try in empty qml file.
#5
I got my middle-click to work with this code. but it only works when the left side editor is in focus or when you click on the macro name in the 'Open Items' the first time that macro is brought into the 'Open Items' list.

shouldn't it work 'all' the time?
thanks!


Function FF_QM_Open_items
Code:
Copy      Help
function# iid FILTER&f
if(!f.hwnd2) ret
if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
An old blog on QM coding and automation.

The Macro Hook
#6
My macro is only for right click trigger. If using middle click, your macro must rightclick to show menu.
#7
I think it's conflicting with some of my other macs and filter functions that use QM and middle click.
do i take these two and combine them into one with an integer'd case statement?

Function FF_QM_menu_File2
Code:
Copy      Help
if(GetWinId(f.hwnd2)!=2202) ret

int+ g_qm_menu_iid
TVHITTESTINFO ht
GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
SendMessage f.hwnd2 TVM_HITTEST 0 &ht
if(ht.hItem)
,TVITEM ti.hItem=ht.hItem
,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
,g_qm_menu_iid=ti.lParam
else g_qm_menu_iid=0
;out g_qm_menu_iid

ret iid


Function FF_QM_Open_items
Code:
Copy      Help
;/
function# iid FILTER&f
if(!f.hwnd2) ret
if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
;if(wintest(f.hwnd "Open items" "SysTreeView32" "qm")) ret iid
An old blog on QM coding and automation.

The Macro Hook
#8
BTW:is there a way i can call that new little floating toolbar with the button to move the newly opened macro to the secondary editor?
An old blog on QM coding and automation.

The Macro Hook
#9
>do i take these two and combine them into one with an integer'd case statement?
yes. Or FFs can return -2 when they don't return iid, but it is more overhead because two FFs called for single event.

------------

bug: context menu appears again if mouse is still there. Esc will help.
Macro
Trigger #Mh1 0x8 /QM /FF_qm_mouse_is_on_open_items     Help - how to add the trigger to the macro
Code:
Copy      Help
rig
wait 1 WV "+#32768" ;;wait for menu
key r Z ;;Move to Right
err+

------------

The button does
men 33293 id(2213 _hwndqm) ;;Move to Right
or
men 33294 id(2213 _hwndqm) ;;Move to Bottom
depending on where secondary editor is.
The toolbar cannot be opened from a macro.
#10
Ah...now i see why mine didn't work when I hadn't selected something. You HAVE to have a macro selected in order for the menu option to work on something.

now I'm using this to move things to the right.

Macro
Trigger #Mh1 0x8 /QM /FF_QM_Open_items     Help - how to add the trigger to the macro
Code:
Copy      Help
spe
lef
men 33293 id(2213 _hwndqm) ;;Move to Right

thanks for your help Gintaras!
An old blog on QM coding and automation.

The Macro Hook
#11
I've just about got this licked but I need a hand with this last part.
When I mid-click on the 'open items' it sends the macro under it to the 2ndy editor. when i click in the 'list of items' frame it should start a pop up menu. but the second part isn't working. from the 'outs' I see that it's getting into the right section of code but it doesn't start it.

can you tell me where i'm going wrong here?

thanks.

Function FF_QM_Open_items
Code:
Copy      Help
function# iid FILTER&f

if(!f.hwnd2) ret
;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
;out
if(f.hwnd=_hwndqm)
,_i=GetWinId(f.hwnd2)
,if _i=2212
,,out _i
,,ret iid
,,end
,if _i=2202
,,_s.time("%c")
,,_s.from("2202 started " _s)
,,out _s
,,int+ g_qm_menu_iid
,,TVHITTESTINFO ht
,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
,,if(ht.hItem)
,,,TVITEM ti.hItem=ht.hItem
,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
,,,g_qm_menu_iid=ti.lParam
,,else g_qm_menu_iid=0
,,;out g_qm_menu_iid
,,ret iid
An old blog on QM coding and automation.

The Macro Hook
#12
wait...I got it to work by setting the pou-up to run 'when released' but when i mid-click it 'closes' the macro i'm over which 'de-selects' it which makes it 'select' the previous macro, which is then acted upon by the pop-up menu.

any thoughts on how i can prevent that?

thanks.
An old blog on QM coding and automation.

The Macro Hook
#13
If Eat checked, should not close because QM then does not receive middle click message. Works for me.

Macro
Trigger #M //FF_QM_Open_items     Help - how to add the trigger to the macro
Code:
Copy      Help
out PopupMenu("a[]b")
#14
I've got 'eat' checked but it's still close it. for instance, when i have a macro opened in the 2ndy editor and then mid-click it 'closes' and reverts to the previous selected macro. it doesn't do that for you?
An old blog on QM coding and automation.

The Macro Hook
#15
Here the item remains open and yellow or blue.
#16
yes, i'm seeing that when i put it by itself in a fresh qml. i can also get it to do that if i call the pop-up menu from the filter function and ret the iid but the pop-up menu goes away in a blink rather than staying there. but, if i don't call the pop-up in the FF and just ret the iid it performs the other mid-click of moving it to the 2ndy editor. here's my code for the FF.

have i got something in the wrong place?

Function FF_QM_Open_items
Code:
Copy      Help
function# iid FILTER&f

if(!f.hwnd2) ret
;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
;out
if(f.hwnd=_hwndqm)
,_i=GetWinId(f.hwnd2)
,if _i=2212
,,out _i
,,ret iid
,,end
,if _i=2202
,,_s.time("%c")
,,_s.from("2202 started " _s)
,,out _s
,,int+ g_qm_menu_iid
,,TVHITTESTINFO ht
,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
,,if(ht.hItem)
,,,TVITEM ti.hItem=ht.hItem
,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
,,,g_qm_menu_iid=ti.lParam
,,else g_qm_menu_iid=0
,,;out g_qm_menu_iid
,,;mac "Menu QM menu File-ken"
,,ret iid

thanks.
An old blog on QM coding and automation.

The Macro Hook
#17
If using mac, don't ret iid, because it launches the macro again.

Do you have more middle click triggers?

Quote:it performs the other mid-click of moving it to the 2ndy editor

? Do you have double middle click triggers? Then single click probably will not work.
#18
yeah, i've got one that opens a pop-up when the 'item list' mid-click happens the other is in 'open items' which moves it to the 2ndy editor. that's what i'm trying to do with the if clause but i'm kind of confused on how the whole FF works. would it be better to scrap the FF and go with a regular function and call each from there?

thanks.
An old blog on QM coding and automation.

The Macro Hook
#19
Without filter function you will disable middle click in all QM windows.

Two macros can have this single FF. One runs when clicked in main list, other when in open items.

Make sure you don't have double middle click triggers.

------
Quote:but i'm kind of confused on how the whole FF works
FF runs on middle button down. If FF returns idd or macro name, that macro will run. If FF returns 0, nothing will run. If -1, nothing will run, and the middle click will not be passed to the window. If -2, the macro will not run, but if there are more macros that have the same trigger, they will run.
#20
ok, got it to work now.
used 'ret' rather than 'mac' to start the macro along with the macros being 'eat' and 'when released' checked.


Function FF_QM_Open_items
Code:
Copy      Help
function# iid FILTER&f

if(!f.hwnd2) ret
;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
;out
if(f.hwnd=_hwndqm)
,_i=GetWinId(f.hwnd2)
,if _i=2212
,,out _i
,,ret "Move Mac to 2ndy Editor"
,,;ret iid
,,;end
,if _i=2202
,,_s.time("%c")
,,_s.from("2202 started " _s)
,,out _s
,,int+ g_qm_menu_iid
,,TVHITTESTINFO ht
,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
,,if(ht.hItem)
,,,TVITEM ti.hItem=ht.hItem
,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
,,,g_qm_menu_iid=ti.lParam
,,else g_qm_menu_iid=0
,,;out g_qm_menu_iid
,,ret "Menu QM menu File-ken"
,,
,,;ret iid


THANKS.
An old blog on QM coding and automation.

The Macro Hook
#21
did not work because returned iid of first macro in both cases.
#22
ahhh....now i get it.
thanks for all your help!
An old blog on QM coding and automation.

The Macro Hook
#23
I put this notice here for better history but this stopped working in 2.3.3.2 (I didn't test with 2.3.3.1). Are the FF working somewhat differently?

Function FF_QM_Open_items
Code:
Copy      Help
function# iid FILTER&f

if(!f.hwnd2) ret
;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
;out
if(f.hwnd=_hwndqm)
,_i=GetWinId(f.hwnd2)
,if _i=2212
,,ret "Move Mac to 2ndy Editor"
,if _i=2202
,,;_s.time("%c")
,,;_s.from("2202 started " _s)
,,;out _s
,,int+ g_qm_menu_iid
,,TVHITTESTINFO ht
,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
,,if(ht.hItem)
,,,TVITEM ti.hItem=ht.hItem
,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
,,,g_qm_menu_iid=ti.lParam
,,else g_qm_menu_iid=0
,,;out g_qm_menu_iid
,,ret "Menu QM menu File-ken"
An old blog on QM coding and automation.

The Macro Hook
#24
it looks like the FF isn't initiating.
An old blog on QM coding and automation.

The Macro Hook
#25
YOu know what...I just switched it to use double left which is much better.
An old blog on QM coding and automation.

The Macro Hook
#26
Anyway, it was a bug, and some other triggers also may not work.
Fixed in 2.3.3.3.
http://{deleted post}


Forum Jump:


Users browsing this thread: 1 Guest(s)