Skip to content

Commit

Permalink
- Revised Back/Forward for browsers on Windows, added Undo closed tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreaves committed Feb 11, 2021
1 parent 1a836d2 commit 7647ceb
Showing 1 changed file with 37 additions and 39 deletions.
76 changes: 37 additions & 39 deletions windows/kinto.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,20 @@ GroupAdd, intellij, ahk_exe idea64.exe
#if
#if winactive("ahk_group browsers")
$^Left::
Gosub GetSelectedTextLeft
if(blinking()){
Send, {Home}
}
else{
Send, !{Left}
}
Return
$^Right::
Gosub GetSelectedTextRight
if(blinking()){
Send, {End}
}
else{
Send, !{Right}
}
Return
#if
$^+Left::Send +{Home}
Expand Down Expand Up @@ -479,6 +489,14 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Dev Tools
!^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up}
!^j::send {Ctrl Down}{Shift Down}j{Shift Up}{Ctrl Up}
; Reopen closed tab or Undo text field
$^z::
if(blinking()){
Send, ^z
}
else{
Send, ^+t
}
; Open preferences
#IfWinActive ahk_exe firefox.exe
^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter}
Expand Down Expand Up @@ -771,40 +789,20 @@ Send {RShift up}
Send {LShift up}
return

GetSelectedTextLeft:
ClipSaved := ClipboardAll
clipboard := ""
Send, {Left}{Left}{Right}
Send, +{Right}
Send, ^c
Send, {Left}
ClipWait, 0.2
if(clipboard == "" ){
Send, !{Left}
}
else{
Send, {Home}
}
Sleep, 100
clipboard := ClipSaved
ClipSaved := ""
return

GetSelectedTextRight:
ClipSaved := ClipboardAll
clipboard := ""
Send, {Left}{Left}{Right}
Send, +{Right}
Send, ^c
Send, {Left}
ClipWait, 0.2
if(clipboard == "" ){
Send, !{Right}
}
else{
Send, {End}
}
Sleep, 100
clipboard := ClipSaved
ClipSaved := ""
return
blinking(){
ClipSaved := ClipboardAll
clipboard := ""
status := False
Send, {Left}{Left}{Right}
Send, +{Right}
Send, ^c
Send, {Left}
ClipWait, 0.2
if(clipboard != "" ){
status := True
}
Sleep, 100
clipboard := ClipSaved
ClipSaved := ""
return status
}

0 comments on commit 7647ceb

Please sign in to comment.