Skip to content

Commit

Permalink
Merge pull request #2 from reinhello/patch
Browse files Browse the repository at this point in the history
Update script
  • Loading branch information
reinacchi committed Aug 30, 2022
2 parents a3c608a + 8280572 commit 3e8c06e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 56 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ Click [Here](https://github.com/reinhello/quick_mouse/releases/latest/download/q

# How to Use

There are two modes available which each mode represents and behave differently. `Normal Mode` allows your keyboard to move the mouse around while `Insert Mode` allows you to type regularly like a normal keyboard.
There are two modes available which each mode will represents a different control. See below for more:

## Controls

## Mode

- `Pause` - Enter `Normal` mode. You are able to move the cursor around
- `Insert` - Enter `Insert` mode. You are able to use your keyboard regularly.
- `Pause` - Switch between modes. Each mode behaves to control the cursor and other to acts like a regular keyboard.

### Cursor

Expand Down Expand Up @@ -48,6 +47,8 @@ There are two modes available which each mode represents and behave differently.
- `Shift+D` - Position the cursor right side of the screen
- `Shift+Y` - Yank the mouse

- **Custom hotkeys are not supported in the meantime.**

## Contributing

Contributions are welcome!
79 changes: 26 additions & 53 deletions quick_mouse.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
; quick_mouse
;
; Reinhardt
; 2022.820.0
; 2022.830.0

global INSERT_MODE := false
global NORMAL_MODE := false
global INSERT_MODE := False
global NORMAL_MODE := False

global FORCE := 1.8
global RESISTANCE := 0.982

global VELOCITY_X := 0
global VELOCITY_Y := 0

EnterNormalMode()
SwitchMode(True)

Accelerate(velocity, pos, neg) {
If (pos == 0 && neg == 0) {
Expand All @@ -41,7 +41,7 @@ MoveCursor() {
UP := UP - GetKeyState("w", "P")
RIGHT := RIGHT + GetKeyState("d", "P")

If (NORMAL_MODE == false) {
If (NORMAL_MODE == False) {
VELOCITY_X := 0
VELOCITY_Y := 0
SetTimer,, Off
Expand All @@ -55,23 +55,28 @@ MoveCursor() {
MouseMove, %VELOCITY_X%, %VELOCITY_Y%, 0, R
}

EnterNormalMode(quick:=false) {
If (NORMAL_MODE) {
Return
}
NORMAL_MODE := true
INSERT_MODE := false
SwitchMode(init=False) {
If (init == True) {
NORMAL_MODE := True
INSERT_MODE := False

SetTimer, MoveCursor, 16
}
SetTimer, MoveCursor, 16
} Else {
If (NORMAL_MODE) {
NORMAL_MODE := False
INSERT_MODE := True

Return
}

EnterInsertMode(quick:=false) {
If (INSERT_MODE) {
Return
If (INSERT_MODE) {
NORMAL_MODE := True
INSERT_MODE := False

SetTimer, MoveCursor, 16
}
}

INSERT_MODE := true
NORMAL_MODE := false
}

Drag() {
Expand Down Expand Up @@ -148,14 +153,6 @@ JumpRightEdge() {
MouseMove, x,y
}

MouseBack() {
Click, X1
}

MouseForward() {
Click, X2
}

ScrollUp() {
Click, WheelUp
}
Expand All @@ -172,31 +169,7 @@ ScrollLeft() {
Click, WheelLeft
}

ScrollUpMore() {
Click, WheelUp
Click, WheelUp
Click, WheelUp
Click, WheelUp
Return
}

ScrollDownMore() {
Click, WheelDown
Click, WheelDown
Click, WheelDown
Click, WheelDown
Return
}

Break:: EnterNormalMode()
Insert:: EnterInsertMode()
<#<!n:: EnterNormalMode()
<#<!i:: EnterInsertMode()

+Break:: Send, {Break}
+Insert:: Send, {Insert}
^Capslock:: Send, {Capslock}
^+Capslock:: SetCapsLockState, Off
Break:: SwitchMode()

#If (NORMAL_MODE)
w:: Return
Expand All @@ -212,8 +185,8 @@ e:: MouseLeft()
q:: MouseRight()
r:: MouseMiddle()
+Y:: Yank()
*n:: Drag()
*m:: RightDrag()
n:: Drag()
m:: RightDrag()
i:: ScrollUp()
j:: ScrollLeft()
k:: ScrollDown()
Expand Down

0 comments on commit 3e8c06e

Please sign in to comment.