Jump to content

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

One finger scroll with trigger key (touchpad)


  • Please log in to reply
No replies to this topic
chripopper
  • Members
  • 5 posts
  • Last active: Feb 18 2014 06:16 PM
  • Joined: 23 May 2011

Hi i'm trying to get a trigger key turning my whole touchpad to a scroll pad so i can scroll with one finger. I've tried all scripts similar to this but every one has one It works in notepad for example, but when i press the trigger key in both spotify and chrome, the cursor jumps a little bit up and to the left, and as soon as i touch the touchpad the page scrolls to the top i lightning speed.

 

This is for example the last script i tried:

;;
;; Emulate_Scrolling_Middle_Button.ahk
;; Author: Erik Elmore <[email protected]>
;; Version: 1.1 (Aug 16, 2005)
;;
;; Enables you to use any key with cursor movement
;; to emulate a scrolling middle button.  While
;; the TriggerKey is held down, you may move the
;; mouse cursor up and down to send scroll wheel
;; events.  If the cursor does not move by the
;; time the TriggerKey is released, then a middle
;; button click is generated.  I wrote this for my
;; 4-button Logitech Marble Mouse (trackball),  
;; which has no middle button or scroll wheel.
;;

;; Configuration

;#NoTrayIcon

;; Higher numbers mean less sensitivity
esmb_Threshold = 5

;; This key/Button activates scrolling
esmb_TriggerKey = Launch_Media

;; End of configuration

#Persistent
CoordMode, Mouse, Screen
Hotkey, %esmb_TriggerKey%, esmb_TriggerKeyDown
HotKey, %esmb_TriggerKey% Up, esmb_TriggerKeyUp
esmb_KeyDown = n
SetTimer, esmb_CheckForScrollEventAndExecute, 10
return

esmb_TriggerKeyDown:
  esmb_Moved = n
  esmb_FirstIteration = y
  esmb_KeyDown = y
  MouseGetPos, esmb_OrigX, esmb_OrigY
  esmb_AccumulatedDistance = 0
return

esmb_TriggerKeyUp:
  esmb_KeyDown = n
  ;; Send a middle-click if we did not scroll
  if esmb_Moved = n
    MouseClick, Middle
return

esmb_CheckForScrollEventAndExecute:
  if esmb_KeyDown = n
    return
  
  MouseGetPos,, esmb_NewY
  esmb_Distance := esmb_NewY - esmb_OrigY
  if esmb_Distance
    esmb_Moved = y

  esmb_AccumulatedDistance := (esmb_AccumulatedDistance + esmb_Distance)
  esmb_Ticks := (esmb_AccumulatedDistance // esmb_Threshold) ; floor divide
  esmb_AccumulatedDistance := (esmb_AccumulatedDistance - (esmb_Ticks * esmb_Threshold))
  esmb_WheelDirection := "WheelDown"
  if (esmb_Ticks < 0) {
    esmb_WheelDirection := "WheelUp"
    esmb_Ticks := (-1 * esmb_Ticks)
  }

  ;; Do not send clicks on the first iteration
  if esmb_FirstIteration = y
    esmb_FirstIteration = n
  else {
    Loop % esmb_Ticks {
      MouseClick, %esmb_WheelDirection%
    }
  }

  MouseMove,

Any suggestions?