AutoHotkey Community

It is currently May 27th, 2012, 12:12 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 241 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17  Next
Author Message
 Post subject:
PostPosted: December 31st, 2011, 3:02 pm 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
Good news, even the last day of the year our R3gX is working!

Thank you so much for this update; I just downloaded it and performed the usual setup operations.

Congratulations for the clean-up: the script now looks definately clear and efficient.

Some quick notes after testing it for some minutes:

1) did you remove the "Minimal distance" parameter, or is it changed in another variable?
I think gesture length is a tad too short now.

2) I see that the gesture's tooltip now follow closely the mouse pointer during gesture drawing, is this the new wanted behaviour?
At first glance I find more aesthetically pleasing the previous setting because now the tooltip is not smooth but flickering around instead. Maybe is just matter of getting accustomed to the new way.

Well, that's all for now, as always I'll report back here any feedback on this great piece of code.

Happy new year everybody! ^__^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2011, 7:04 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
@Carrozza :
Quote:
Good news, even the last day of the year our R3gX is working!
I'm on holiday and I'm alone the two next days so I do what I like when I have free time : scripting with the great AHK_L !

For 1) & 2), here are the solutions
Code:
mgr_MonitorGesture()
{ ; Monitor the mouse directions to get the gesture
   MouseGetPos, OriginX, OriginY
   While GetKeyState("RButton", "P"){
      If GetKeyState("Esc", "P")
         Return
      Sleep, 10
      MouseGetPos, MouseX, MouseY   
      If ( Sqrt((MouseX-OriginX)**2+(MouseY-OriginY)**2) >= 5 ){ ; 5 is the ex-MinimalDistance.
         Directions   .=   "-" mgr_GetDirection(MouseX-OriginX, MouseY-OriginY)
         Gesture      :=   mgr_GetModifiers() mgr_Filter(Directions)
         Command      :=   mgr_GetCommand(Gesture, 1)
         Msg         := Command ? Command : Gesture
         If (Msg<>LastMsg) ; Avoid flickering effect
            ToolTip, % Msg

         OriginX := MouseX , OriginY := MouseY , LastMsg := Msg
      }
   }
   Return, Gesture
}

1) The "MinimalDistance" is present only one time in the function so I decided to remove the variable declaration. As the filter works quite well, the value can now be very small.

Quote:
Well, that's all for now, as always I'll report back here any feedback on this great piece of code.
I hope so!
Quote:
Happy new year everybody! ^__^
Happy new year to you and to everybody too!

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2011, 9:08 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
I just added all needed comments to document the MGR.ahk file.
I'm out of new features so if you have one, please tell me and maybe I'll code it!
I know that it's not the hour so I'll wait!

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 1st, 2012, 9:44 pm 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
Thanks R3gX, your solution works flawlessly and the script is as smooth and stable as it can be.

Awesome work!

Oh, and about the spare time... I think we are all in the same boat over these forums. ^__^


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 4th, 2012, 10:42 am 
I am not fluent in English, I hope you can understand I want to express.

The previous version:

Code:
   UL-L-DL-D-DR-D-DL-L-UL:
   UL-L-DR-D-DL-L:
   L-DR-D-L-UL:
   UL-L-DL-DR-DL-L-UL:
   L-DL-DR-D-DL-L-UL:
   UL-L-D-DR-L:
   L-D-DR-DL-L:
             …………
ToolTip,You trigger the "s" gesture.
return

   L-D-L:
ToolTip,You trigger the "L-D-L" gesture.
return



And now only the formation of "LDL" a gesture of.


That is now unable to form a complex gesture, and in my opinion, this is a step backwards. Than the previous version "strokeit" more powerful software, and now can only form a few simple gestures. Like my favorite 'S' gesture, and now can not be formed. Hope you can return to the previous function, can learn to function, resulting in some point of the complex gestures.

Thank you for your efforts.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2012, 3:39 pm 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
Doh, I would never thought that someone could want a gesture that strange just to mimic a letter shape.

I'd prefer the script to stay as it is currently; the latest release behaves *much* better then before: fast, solid, I had zero mistakes in gesture recognition in a week of strong use.

I am a former user of Stroke-it and agree that its gesture record system is very smooth and precise, but I'd never go back to it because of the huge amount of flexibility Autohotkey gives us.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2012, 10:48 am 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
@Guest : I understood what you asked me and I agree that the latest version of MGR allows fewer gestures.
However, to leave the choice between the old and the new version I would have to rewrite the lines that I removed.
Once rewritten, the filter can be left as an option. Sorry but I don't want it!
If you want to do a "S" shape, try "L-D-R-D-L"

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2012, 9:59 am 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
Hi all,
just wanted to drop by and say how much I'm happy with this new version of MGR. It almost changed the way I use the mouse, is so quick and precise.

Thanks a lot R3gX!!!

Ciao! ^__^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2012, 5:35 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
Hi everyone!

@Carrozza : I really appreciate!!!

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: weird bug? or just me?
PostPosted: January 21st, 2012, 3:05 am 
I was looking at your script and I really like the way it works; I tried integrating it into my main AHK script, but it didn't work. I finally narrowed it down to one clause in my script, and all I can do is scratch my head and wonder why.

So to test, I took the unedited v0.8.2 script and added three lines to the bottom of MGR_Sample.ahk:

Code:
#SingleInstance, Force
#NoEnv

SetWorkingDir, %A_ScriptDir%
SetBatchLines, -1

#Include, C:\Users\User\Documents\Work\Com\Scripts\v0.8.2\MGR\MGR.ahk
#Include, C:\Users\User\Documents\Work\Com\Scripts\v0.8.2\MGR\MGR_UDF.ahk

Return

; Toggle the state of MGR
~MButton & RButton::
Hotkey,   *RButton,   Toggle
Hotkey,   #RButton,   Toggle
Return

#ifWinActive ahk_class Sticky_Notes_Note_Window
{
}


For some (evil) reason Sticky Notes (Windows 7 64bit, if it matters) causes the script to be non-functional. I tried other #ifWinActive functions (eg. #ifWinActive ahk_class CabinetWClass & #ifWinActive Notepad) but those don't affect the script. Only when it has to do with Sticky Notes. I tried updating AutoHotKey, and it's the same thing.

Any idea why this is happening or is it just me? In the meantime, I'm going to disable the Sticky Note functions.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2012, 11:24 am 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
Hi everyone!

@aahehe : I didn't try MGR on a 64bit version so for now, I don't know where is the problem. Could you send me your main script or the part concerned by StickyNotes, please? This week-end, I'll download StickyNotes and try it with the code.

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2012, 8:22 am 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
@ aahehe
I'm using MGR with Windows 7 64 bit and so far had no issues with specific software packages making the script hang.
Sorry but at the moment I can't think of what could be causing this weird behaviour... if anything come up I'll come back here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Challenge
PostPosted: January 24th, 2012, 10:07 am 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
OK, here is a new challenge, what I'd like to implement is this set of actions:
1) right mouse button held down, mouse moving: trigger gesture;
2) RMB held down, mouse still:
2a) if wheel scrolls Up or Down then increase or decrease volume;
2b) if nothing happens for 400ms then trigger task manager.

All this stuff shoule be compatible with existing Accellerated Scrolling instructions already in place:
Code:
~$WheelUp::
~$WheelDown::
   if (A_PriorHotkey = A_ThisHotkey && (G_TimeSincePriorHotkey := A_TimeSincePriorHotkey) < G_Timeout)
      {   ; if it's the same hotkey and in the timeframe we want
      StringTrimLeft,G_ThisHotkey,A_ThisHotkey,2  ; remove ~$ from the string of the hotkey
      MouseClick,%G_ThisHotkey%,,,(G_Timeout - G_TimeSincePriorHotkey)*G_limit//G_Timeout
      }
   Return


This is my partial, incomplete, not working try:
Code:
mgr_MonitorRButton()
{ ; Monitor the mouse right button
   mgr_MonitorRButton:
   MouseGetPos, mX1, mY1
   While GetKeyState("RButton", "P"){
      Sleep, 10
      MouseGetPos, mX2, mY2
      If (Abs(mX2-mX1)>5 || Abs(mY2-mY1)>5)
         {
         If ( Gesture := mgr_MonitorGesture() )
            If ( Command := mgr_GetCommand(Gesture) )
               SendInput, %Command%
         ToolTip
         Return
         }
      If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND WheelUp=1)
         {
         Send {Volume_Up}
         Return
         }
      If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND WheelDown=1)
         {
         Send {Volume_Down}
         Return
         }
      If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND A_TimeSinceThisHotkey>400 AND WheelUp!=1 AND WheelDown!=1)
         {
         MouseMove, 720, 610
         Send ^!{Tab}
         KeyWait, RButton
         Sleep, 10
         Send {LButton}
         Return
         }
   }
   SendInput, % mgr_GetModifiers() "{RButton}"
   Return
}


I know I'm making the right-button pretty busy, but you know what: if I have my hand over there why move it?

Cheers! ^__^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2012, 1:57 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
Hi everyone !

@Carrozza : As I told you in a previous script, I don't want to change the MGR code.
For accelerated scrolling and volume features, I advise you this code
Code:
WheelUp::Scroll()
WheelDown::Scroll()

#If MouseIsOver("Shell_TrayWnd")
WheelUp::SendInput, {Volume_Up 5}
WheelDown::SendInput, {Volume_Down 5}


/*
Detect where the mouse is over (inspired by AHK helpfile)
Author : R3gX
*/
MouseIsOver(ValueToCompare){
   If !StrLen(ValueToCompare)
      Return, 0
    MouseGetPos,,, CurrentWinID
   WinGetTitle, CurrentWinTitle, ahk_id %CurrentWinID%
   WinGetClass, CurrentWinClass, ahk_id %CurrentWinID%
   If   (   ValueToCompare=CurrentWinID
      or   InStr(CurrentWinTitle, ValueToCompare)
      or   ValueToCompare=CurrentWinClass )
      Return, 1
   Else
      Return, 0
}

/*
Accelerates the scrolling
Author         : BoffinbraiN (Thanks!)
Modified by      : R3gX
Original link   : http://www.autohotkey.com/forum/viewtopic.php?t=52470
*/
Scroll(){
   static distance := 0 , vmax := 1 , timeout=500, boost=30, limit=60
   t := A_TimeSincePriorHotkey
   If (A_PriorHotkey=A_ThisHotkey && t<timeout){
      ; Remember how many times we've scrolled in the current direction
      distance++
      ; Calculate acceleration factor using a 1/x curve
      v := (t>1 && t<80) ? (250/t)-1 : 1
      ; Apply boost
      If (boost>1 && distance>boost){
         ; Hold onto the highest speed we've achieved during this boost
         If (v>vmax)
            vmax := v
         Else
            v := vmax
         v *= distance/boost
      }
      ; Validate
      v := (v>1) ? ((v>limit) ? limit : Floor(v)) : 1
      MouseClick, %A_ThisHotkey%, , , v
   } Else {
      ; Combo broken, so reset session variables
      distance := 0 , vmax := 1
      MouseClick %A_ThisHotkey%
   }
}

Quote:
2b) if nothing happens for 400ms then trigger task manager.
You already have the code.

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2012, 8:11 am 
Offline

Joined: July 5th, 2009, 7:27 pm
Posts: 188
Oh, thanks mate, where you on vacation? Eheh, just joking! :-p

I agree with you on keeping MGR as clean as possible; to be honest after some days of playing around I ended up using a gesture to fire the audio volume pop-up (SndVol.exe), which keeps MGR straightforward approach and gives me a visual feedback of the volume level. The script also closes the pop-up after 3 seconds, so the workflow is smooth and fast.

As for the scrolling script I'll try out the one you posted: at the moment I'm using a different one but it doesn't behave perfectly in my humble opinion: the accelleration is sudden, not gradual. I'm getting spoiled with all these wonderful scripts.

Cheers R3gX and every MGR happy user! ^__^


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 241 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group