Jump to content

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

Release: Anti-RSI Click with the keyboard instead mouse


  • Please log in to reply
No replies to this topic
HelgeFin
  • Members
  • 12 posts
  • Last active: Jul 23 2010 10:30 AM
  • Joined: 04 Apr 2007
Features:
* press "i" or "g" to use the keyboard just normal
* automatic switching to mouse-mode on mouse move

This should be pretty self-explanatory. Your welcome to ask questions. Its simple, but nevertheless it took lots of optimizing and testing. Therefore you might want to start with my script instead of starting your own.

You will only get the full effect if you learn to hold the mouse less tense. This is much easier if you don't use the mouse buttons.

This thing is still evolving and you're not seeing the most recent version here. If anyone is interested just post, I'll update this here.

#singleinstance force
#Hotstring *ROC
#Hotstring NoMouse
#Hotstring EndChars -()[]{}:;'"/\,.?!`n `t

;*** keyClickMode

;Space::
;a::
b::
;c::
;d::
;e::
;f::
;g::
; h::
;i::
; j::
; k::
;l::
;LWin::
m::
n::
o::
p::
;q::
;r::
;RShift::
;RWin::
;s::
;Space::
t::
u::
;v::
;w::
;x::
y::
z::
	;If keyClickMode = true
		SoundBeep
	;else
	;   Send, {%A_ThisHotkey%}
	return

; LButton::
; RButton::
	; SoundBeep
	; return
a::
	SendInput,{a Up}
	MouseClick, left
	
	MouseClick, left
	SoundBeep,2000,30
	return
c::
	SendInput,^c
	SoundBeep,2000,30
	return
d::
	SendInput,{MButton}
	SoundBeep,2000,30
	return
e::
	SendInput,{WheelDown}
	return
f::
	GetKeyState, state, RButton  
	if state = U
	{
		SendInput,{RButton down}
		SoundBeep,2000,30
	}
	return
f Up::
	SendInput,{RButton up}
	return
h::
	Send, {left}
	return
j::
   Send, {down}
	return
k::
    Send, {up}
	return
l::
	Send, {right}
	return
; o::
	 ; Send, {End}{Enter}
	 ; GoSub, TypingMode
	; return
q::
	; This is needed quite often when I made a mess because I thought a was in the other mode.
	SendInput,^z
	return
r::
	SendInput,{WheelUp}
	return
s::
	GetKeyState, state, LButton  
	if state = U
	{
		;Click down
		SendInput,{s Up}{LButton down}
		SoundBeep,2000,30
	}
	return
s Up::
	;Click up
	SendInput,{LButton up}
	return
^s::
	SendInput,{Ctrl down}{LButton}
	SoundBeep,2000,30
	return
v::
	SendInput,^v
	SoundBeep,2000,30
	return
w::
	SendInput,{Enter}
	return
x::
	Send, {Delete}
	return
i::
g:: ; For switching to insert-mode while typing one-handly with left hand
Up::
Down::
Right::
Left::
	CoordMode, Mouse, Screen
	MouseGetPos, oldXpos, oldYpos
	FileAppend, InputMode %Xpos% %Ypos% %oldXpos% %oldYpos%`n,c:\AhkLog.txt
	SetTimer, WatchMouse,100
	keyClickMode=false
	SoundBeep,2000,30
	Hotkey,LButton,On	
	Hotkey,MButton,On	
	Hotkey,RButton,On	
	Hotkey,WheelUp,On	
	Hotkey,WheelDown,On	

	Hotkey,a,Off
	Hotkey,b,Off
	Hotkey,c,Off
	Hotkey,d,Off
	Hotkey,e,Off
	Hotkey,f Up,Off
	Hotkey,f,Off
	Hotkey,g,Off
	Hotkey,h,Off
	Hotkey,i,Off
	Hotkey,j,Off
	Hotkey,k,Off
	Hotkey,l,Off
	;Hotkey,LButton,Off
	Hotkey,m,Off
	Hotkey,n,Off
	Hotkey,o,Off
	Hotkey,p,Off
	Hotkey,q,Off
	Hotkey,r,Off
	;Hotkey,RButton,Off
	;Hotkey,RShift,Off
	Hotkey,s Up,Off
	Hotkey,s,Off
	Hotkey,^s,Off
	;Hotkey,Space,Off
	Hotkey,t,Off
	Hotkey,u,Off
	Hotkey,v,Off
	Hotkey,w,Off
	Hotkey,x,Off
	Hotkey,y,Off
	Hotkey,z,Off
	Hotkey,Up,Off
	Hotkey,Down,Off
	Hotkey,Right,Off
	Hotkey,Left,Off
	;Hotkey,LWin,Off
	;Hotkey,RWin,Off
	return

WatchMouse:
	; global oldXpos
	; global oldYpos
	CoordMode,Mouse,Screen
	MouseGetPos, Xpos, Ypos
	FileAppend, Timer: %Xpos% %Ypos% %oldXpos% %oldYpos%`n,c:\AhkLog.txt
	dx:=Abs(oldXpos-Xpos)
	dy:=Abs(oldYpos-Ypos)
	;ToolTip, %a%+"   "+%oldYpos% +"   "+%Ypos% 

	oldXpos:=Xpos
	oldYpos:=Ypos		
	
	if(dx>20 or dy>20)
	{
		FileAppend, Mouse moved!`n,c:\AhkLog.txt
		SoundBeep,50,500
		Gosub LButton
	}

	return
	
CapsLock::
LButton::
MButton::
RButton::
WheelUp::
WheelDown::
	SetTimer, WatchMouse,Off
	;SendInput, {%A_ThisHotkey% down}
	SetCapsLockState, On
	SetCapsLockState, Off
	SetCapsLockState, AlwaysOff
	Hotkey,LButton,Off	
	Hotkey,MButton,Off	
	Hotkey,RButton,Off	
	Hotkey,WheelUp,Off	
	Hotkey,WheelDown,Off	
	Hotkey,a,On	
	Hotkey,b,On
	Hotkey,c,On	
	Hotkey,d,On
	Hotkey,e,On
	Hotkey,f Up,On
	Hotkey,f,On
	Hotkey,g,On
	Hotkey,h,On
	Hotkey,i,On
	Hotkey,j,On
	Hotkey,k,On
	Hotkey,l,On
	;Hotkey,LButton,On
	Hotkey,m,On
	Hotkey,n,On
	Hotkey,o,On
	Hotkey,p,On
	Hotkey,q,On
	Hotkey,r,On
	;Hotkey,RButton,On
	;Hotkey,RShift,On
	Hotkey,s Up,On
	Hotkey,s,On
	Hotkey,^s,On
	;Hotkey,Space,On
	Hotkey,t,On
	Hotkey,u,On
	Hotkey,v,On
	Hotkey,w,On
	Hotkey,x,On	
	Hotkey,y,On
	Hotkey,z,On
	Hotkey,Up,On
	Hotkey,Down,On
	Hotkey,Right,On
	Hotkey,Left,On
	;Hotkey,LWin,On
	;Hotkey,RWin,On
	
	keyClickMode=true
	SoundBeep,2000,30
	return
;*  keyClickMode