AutoHotkey Community

It is currently May 27th, 2012, 6:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 177 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject:
PostPosted: February 20th, 2011, 9:54 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
MainTrane wrote:
What's the proper syntax for defining multiple processes in a single line?
Read up on if statements here: http://www.autohotkey.com/docs/commands ... ession.htm The example section shows a similar example to what you're trying to do.

The main issue you have wrong is that your "or" clauses are not full expressions... something like: "If I have $1 or if $10". --"If 10" what? You need: "If I have $1 or if I have $10"



MainTrane wrote:
I'm thinking that an alternative method which sends Ctrl (after the activation button is held for a length of time) and remaps WheelUp/WheelDown to perform PgUp/PgDn, while still being held, would be an even smoother way of achieving the ^Pg commands. I hope this wouldn't be too difficult for DtS to accomplish, you would need to workaround MovementCheck.

Hmm... Idea as an alternative to SlowMode could be an easier option. Activating a Ctrl-lock by double clicking (the button wouldn't need to be held), then releasing it with a third button press.
Not sure I understand what you're asking. But it sounds like you're introducing state http://en.wikipedia.org/wiki/State_%28c ... science%29 which is known to confusing when applying to user interfaces, particularly without indication--one of the reasons I added the change mouse cursor.

Feel free to play with these ideas though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2011, 3:48 am 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
Thanks for the tip, the following code works great ;) :arrow:
Code:
GestureU:
  if (WinProcessName = "wordpad.exe" or WinProcessName = "winword.exe" or WinProcessName = "powerpnt.exe" or WinProcessName = "mspub.exe" or WinProcessName = "acrord32.exe")
  {
    Send, ^{PgDn}                                  ;next page
    Return
  }
  else                                             ;bottom of document
    Send, ^{End}
Return

GestureD:
  if (WinProcessName = "wordpad.exe" or WinProcessName = "winword.exe" or WinProcessName = "powerpnt.exe" or WinProcessName = "mspub.exe" or WinProcessName = "acrord32.exe")
  {
    Send, ^{PgUp}                                  ;previous page
    Return
  }
  else                                             ;top of document
    Send, ^{Home}
Return

GestureL:
  if (WinProcessName = "firefox.exe")              ;previous tab in firefox
  {
    Send, ^{PgUp}
    Return
  }
  else                                             ;go back
    Send, !{Left}
Return

GestureR:
  if (WinProcessName = "firefox.exe")              ;next tab in firefox
  {
    Send, ^{PgDn}
    Return
  }
  else                                             ;go forward
    Send, !{Right}
Return
AHK didn't seem to like '|' in place of 'or', plus, as you stated the possessor needed to be stated case-by-case.


I have no coding experience, but if by state you mean I'm attempting to introduce an alternative mode of operation, then yes I'd be introducing state.  I want to replace 'Slow Mode' with a 'Scroll by Page' mode, as opposed to scrolling by lines. I'll see if i can't solve this one in my first crack at complex coding.

Thanks again cheek.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2011, 10:24 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
MainTrane wrote:
I'll see if i can't solve this one in my first crack at complex coding.


How about:
Code:
ButtonDoubleClick:
  Sleep 200
  Send {Esc}

  byPageMode := !byPageMode
  Tooltip((byPageMode ? "Page" : "Regular") . " Mode")

Return


then in Scroll():
Code:
  ; Do scroll
  ;  According to selected method
  ;  wparam is used in all methods, as the final "message" to send.
  ;  All methods check for direction by comparing (NewY < OldY)
  if (byPageMode && !horizontal)
  {
    if (Direction > 0)
      Send ^{PgUp}
    else
      Send ^{PgDn}
  }
  else
if (Method = mWheelMessage)
  {


I personally did not like this at all, but you may find it works better for your use.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2011, 10:58 pm 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
Exactly what i was hoping to do.  You come through again :) , it would have taken me forever to figure out how to code this.

It's great for longer PDF or WORD documents (not to mention image browsers & folders with a long file list), especially if you have the mouse pointer set to a low sensitivity w/ a bit of acceleration.  Page Mode will switch through tabs in Firefox also, though I wouldn't recommend using it that way (I prefer the new L/R flick gestures for that).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2011, 1:31 am 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
You could add filtering for the process name to exclude firefox.exe fairly easily; Switching through firefox tabs was my biggest issue with that setup. I like the idea of GestureL and GestureR for switching tabs, but I just set that to browser back and forward with the following code: (this will probably be in the next release)

Code:
GestureL:
  if WinProcessName in firefox.exe,iexplore.exe,chrome.exe
  {
    ToolTip("Back", 1)
    Send {Browser_Back}
  }
Return

GestureR:
  if WinProcessName in firefox.exe,iexplore.exe,chrome.exe
  {
    ToolTip("Forward", 1)
    Send {Browser_Forward}
  }
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2011, 4:17 pm 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
Here's what my user-customizable handlers look like (included tooltips like you're example):
Code:
byPageMode := !byPageMode
  Tooltip((byPageMode ? "Page" : "Regular") . " Mode")
Return

; Handlers for gesture actions
GestureU:
    ToolTip("End / Bottom")
    Send, ^{End}
Return

GestureD:
    ToolTip("Beginning / Top")
    Send, ^{Home}
Return

GestureL:
    ToolTip("Back / Previous")
    Send, {Browser_Back}
Return

GestureR:
    ToolTip("Forward / Next")
    Send, {Browser_Forward}
Return

_______________________________________________________________________
A couple of things that will need cleaning up in future versions of DtS, depending on what you decide to include.  (1) With UseDoubleClickCheck=True, multiple flick gestures performed within the double-click threshold change the mode of operation.  (2) Flick gestures and page mode scrolling are sent to the window with current keyboard focus instead of activating directly beneath the pointer.  (3) \/ see below \/
cheek wrote:
...state, which is known to be confusing when applying to user interfaces, particularly without indication--one of the reasons I added the change mouse cursor.

If 'page mode' becomes official there will definitely need to be a permanent visual cue, a tooltip isn't enough indication.
_______________________________________________________________________
UPDATE:  quick fixes to activate windows for 'flicking' and 'page scrolls'.  probably not the cleanest way, but it works.
Code:
byPageMode := !byPageMode
  Tooltip((byPageMode ? "Page" : "Regular") . " Mode")
Return

; Handlers for gesture actions
GestureU:
    WinActivate, ahk_id %WinHwnd%
    ToolTip("End / Bottom")
    Send, ^{End}
Return

GestureD:
    WinActivate, ahk_id %WinHwnd%
    ToolTip("Beginning / Top")
    Send, ^{Home}
Return

GestureL:
    WinActivate, ahk_id %WinHwnd%
    ToolTip("Back / Previous")
    Send, {Browser_Back}
Return

GestureR:
    WinActivate, ahk_id %WinHwnd%
    ToolTip("Forward / Next")
    Send, {Browser_Forward}
Return


Code:
  if (byPageMode && !horizontal)
  {
  WinActivate, ahk_id %WinHwnd%
    if (Direction > 0)
      Send ^{PgUp}
    else
      Send ^{PgDn}
  }
  else if (Method = mWheelMessage)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2011, 5:37 pm 
Offline

Joined: August 12th, 2010, 7:05 am
Posts: 13
awesome script.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2011, 5:35 am 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
This may be a stretch, but I added the following scripts into the FireGestures extension as L/R gestures;

Rewind (Go to First Page of History)
Code:
if (gBrowser.sessionHistory.index > 0)
  gBrowser.gotoIndex(0);


Fast Foward (Go to Last Page of History)
Code:
var nav = gBrowser.webNavigation;
var hist = nav.sessionHistory;
nav.gotoIndex(hist.count - 1);

would it be possible for an AHK script ( DragToScroll ;) ) to send these commands to the Firefox browser, or do they need to be sent from within the browsers framework (i.e. an extension).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2011, 9:00 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
Do you have to choose "Watch this topic" every time you reply for it to keep emailing you? It doesn't like to.... Sheesh.

MainTrane wrote:
With UseDoubleClickCheck=True, multiple flick gestures performed within the double-click threshold change the mode of operation. 
Thanks for this; its something to be aware of, I don't think there's a technical bug here, but the settings may need to be tweaked. We've got a lot of functionally assigned to a single button, and it starts to become difficult for this functionality not to overlap. Maybe try simply lowering the doubleclick threshold.

MainTrane wrote:
Flick gestures and page mode scrolling are sent to the window with current keyboard focus instead of activating directly beneath the pointer.
This is because of your handlers for GestureU/L using 'Send.' This autohotkey command is only able to send keystrokes to the active window, which is also the reason why the WheelKey method (simply 'Send {WheelUp}') cannot scroll background windows. Your solution to simply activate it is what I would have done.

MainTrane wrote:
would it be possible for an AHK script to send these commands to the Firefox browser
The code you posted has the ability to interact/read the browser history, which ahk cannot do (not that I know of anyway), so it will not know how far back to go to get to the first entry. AHK can simply 'Send, {Browser_Back}' to go back a single entry in the history. Again, this will only work when the browser is active. You could also send this command multiple times, but you wont know how many you need... maybe sending "a lot" would be sufficient??
Code:
Loop, 50
    Send, {Browser_Back}


bsmagic wrote:
awesome script.
Thanks! Enjoy :)


Last edited by cheek on March 10th, 2011, 9:08 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2011, 9:01 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
Does anyone know if there's something like this for Mac? I know the touchpad and magic mouse have the two finger scrolling, but I often use a regular USB mouse and I cant break the right-click-drag habit. I keep selecting things from the context menu.... Doh.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2011, 4:24 am 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
cheek wrote:
Do you have to choose "Watch this topic" every time you reply for it to keep emailing you? It doesn't like to.... Sheesh.
lol, I always get e-mail updates on watched topics, even after several months. Maybe you haven't selected the following option in your profile :arrow: "Always notify me of replies:"

cheek wrote:
Thanks for this; its something to be aware of, I don't think there's a technical bug here, but the settings may need to be tweaked. We've got a lot of functionally assigned to a single button, and it starts to become difficult for this functionality not to overlap. Maybe try simply lowering the doubleclick threshold.
Indeed, there is a lot assigned to the active button (MButton for me). I've already lowered the multi-click threshold in mouse properties as far as I can while keeping the ability to triple-click :x . I usually end up changing modes while trying to rapidly go back a couple pages/folders in a browsers history.

Speaking of doing too much with MButton :roll: . I inserted the following code at the end of DtS. Unfortunately ended up having to line out commands that begin with MButton so as to not break DtS.
Code:
;;;;;  Rocker & Wheel Gestures  ;;;;;
~LButton & RButton::Send, {LButton Up}^c
~LButton & MButton::Send, {F2}
~RButton & LButton::Send, ^v
~RButton & MButton::Send, !{Enter}
;~MButton & LButton::Send, {F5}
;~MButton & RButton::Send, {Esc}
~LButton & WheelUp::Send, ^{PgUp}
~LButton & WheelDown::Send, ^{PgDn}
~RButton & WheelUp::Send, {Browser_Forward}
~RButton & WheelDown::Send, {Browser_Back}
;~MButton & WheelUp::       
;    WinRestore, ahk_id %win2%
;Return
;~MButton & WheelDown::
;if (WinHwnd<>WinDesktop)
;    WinMinimize, ahk_id %WinHwnd%
;Return

;~MButton & Enter::Reload
;~MButton & Delete::ExitApp


cheek wrote:
The code you posted has the ability to interact/read the browser history, which ahk cannot do (not that I know of anyway), so it will not know how far back to go to get to the first entry.
I thought that one would be a stretch ;)

cheek wrote:
Does anyone know if there's something like this for Mac? I know the touchpad and magic mouse have the two finger scrolling, but I often use a regular USB mouse and I cant break the right-click-drag habit. I keep selecting things from the context menu.... Doh.
Here you go cheek, Smart Scroll, not free though :(
OSX also appears to have grab-scrolling built in :arrow: http://www.usingmac.com/2009/8/4/daily-trick-21
Another, MaxiMice, not free
Yet another, Scrollabillity, not free

I've never used a MAC (well not for 20+yrs), so can't vouch for any of these.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks!
PostPosted: March 14th, 2011, 8:01 pm 
Just a note from a random user -- Thanks for a great tool!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 12:10 am 
Offline

Joined: October 13th, 2010, 3:28 am
Posts: 41
I don't know if you're aware of this -> IronAHK (alpha): cross platform .NET rewrite of AutoHotkey.

Maybe you could use it to port your script over to OS X.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 31st, 2011, 11:33 pm 
Offline

Joined: March 31st, 2011, 11:19 pm
Posts: 1
This is a great MouseImp replacement that works on Chrome with nice iPhone-like momentum feature.

If I can throw a few suggestions that are humbly 'in my opinion':

1) When drag-scrolling inside a broswer that includes scrollable text windows, don't scroll the text of the text windows unless the right-click point of origin is already inside the window. This allows the user to scroll all the way to the bottom without unintended sub-scrolls.

2) Make the scrolling smoother (finer increments) like MouseImp.

3) Change the icon to a closed/grasping hand when drag-scrolling.

4) Include instructions in your Readme documentation for non-techies that want to start Windows with the hotkey.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2011, 11:40 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
Thanks drewwesley, gleeby; glad folks are still finding this :) I submitted this to Lifehacker a few times, but haven't seen a post about it. Thanks to MainTrane for submitting it to the MouseImp site. Feel free to submit this to any relevant blogs or sites; I'd love for it to explode :)

I pushed out a new version today 2.4, that is primarily a bug- and compatibility-fixes release.

This update fixes a minor bug for all apps which do not report control id's, instead sending the scrolling to the parent window, rather than the specific control. There is also a new setting that forces this behavior. This fixes scrolling for Firefox4, Visual Studio 2010, and I suspect may also help in Java apps, and some of the other previously reported apps. Try using WheelMessage in these apps, if you've previously switched to the WheelKey method.

Also included are Browser Back/Forward gestures, and a tweak to the AllSettings gui to show non-default values. Unfortunately I could not get this behavior on the various controls in AppSettings.

Download the new version from the first post. See the included ReadMe for more info on this version.

In reply to some of the recent comments & suggestions:
MainTrane wrote:
I don't know if you're aware of this -> IronAHK (alpha): cross platform .NET rewrite of AutoHotkey. Maybe you could use it to port your script over to OS X.
DtS depends on windows messaging for the default "WheelMessage" mode (WM_MOUSEWHEEL), so a port to another system is unlikely. See more below for a bit more about how DtS works.

drewwesley wrote:
3) Change the icon to a closed/grasping hand when drag-scrolling.

4) Include instructions in your Readme documentation for non-techies that want to start Windows with the hotkey.
3) should already exist in the current version. Take a look at the tray icon to see the open/close behavior in action as you're dragging. 4) is done in this release. Thanks!

drewwesley wrote:
1) When drag-scrolling inside a broswer that includes scrollable text windows, don't scroll the text of the text windows unless the right-click point of origin is already inside the window. This allows the user to scroll all the way to the bottom without unintended sub-scrolls.

2) Make the scrolling smoother (finer increments) like MouseImp.
Unfortunately neither of these are something I can control in this script, due the the way it is designed. See my post below for more.


Last edited by cheek on April 9th, 2011, 12:10 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 177 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11, 12  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 20 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