Why codes disabled my "6" key..?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
akirofe
Posts: 160
Joined: 05 Apr 2021, 21:54

Why codes disabled my "6" key..?

Post by akirofe » 01 May 2024, 03:34

Hi, so sorry for the long codes attached, but I tried "search" for any "6" in it to no avail as to why it disabled my "6" key...??!!!?? Thank you very much guys!!! :clap: :clap: :clap: :clap:

Code: Select all

       ;;;;; Stopped working when convert from v1 to v2
; #IfWinActive, ahk_exe ShareX.exe $ESC::return

;F24 instead of F4 as we need F4 in certain situations
;cannot use Ctrl in Rbutton because won't work with TeamViewer (eg. Windows to Mac)

#SingleInstance Force

; REMOVED: #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.

/* Stopped working when convert from v1 to v2
SendMode("Input")  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir(A_ScriptDir)  ; Ensures a consistent starting directory.
*/

ScrollLock::ExitApp()



/*   ---unallocated / what are these?
{
ToolTip "Available"
SetTimer () => ToolTip(), -3000
Return
}
{
Sleep(300)
Send("{e}")
Send("{w}")
return
}

{
Sleep(300)
Send("{f}")
Send("{f}")
return
}
{
Sleep(300)
Send("{v down}")
Send("{v up}")
Send("{v down}")
Send("{v up}")
return
}
>^F21::
{
Send("{Space}")
Send("ndquach.com")
return
; >^MButton::send 0420946997  may interfere with real MButton - check asap if use
}
;;;;;;;;;;;;;;;;;;;;;;;;;>^F3::
>^F24::Send("{y}")
>^F5::Send("{n}")
;;;;;;;>^F6::send
>^F7::Send("{architect.sydney@icloud.com}")
;;;;;;;>^F8::
;;;;;;;>^F9::
;;;;;;;>^F10::
;;;;;;;>^F11::
>^F12::#d

<^<+LButton::Send("{Tab}")
<^<+WheelDown::Send("{LButton}")
<^<+WheelUp::Send("{RButton}")
*/



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   * & Ctrl::  * & Shift::    * & window::    * & wheelup/down::    * & ::   * & ::



/*
; WarlordAkamu67  :  This will make F3 send Enter on a press, and block mouse movement on a hold. While holding F3, the keys "a", "b", and "c" can be used to display a MsgBox- alter to your liking.

#Requires AutoHotkey v2.0

key_is_Held := 0

; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;
; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;
; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;

multiKey() {
  if (GetKeyState("F3", "P")) {
    BlockInput("MouseMove")
    global key_is_Held := 1
    while (GetKeyState("F3", "P")) {
      Sleep(100)
}
    global key_is_Held := 0
    BlockInput("MouseMoveOff")
} else {
    Send("{Enter}")
}
  return
}

; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;
; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;
; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;

F3:: {
  SetTimer(multiKey, -200)
  KeyWait("F3")
  return
}

; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;

#HotIf (key_is_Held)
a:: {
  MsgBox("Extra Function on F3 + a")
  return
}

b:: {
  MsgBox("Extra Function on F3 + b")
  return
}

c:: {
  MsgBox("Extra Function on F3 + c")
  return
}
*/

;#Requires AutoHotkey v2.0
PrintScreen Up:: {
	Static Block := False
	BlockInput (Block:=!Block)
}

;#Requires AutoHotkey v1.1.33
;+F23 Up::BlockInput,% (Block:=!Block)?"On":"Off"

^3::Send("{LButton 2}")
^4::Mbutton 

F21::Send("{WheelUp 5}")
F2::MButton
;Send("{LButton 33}")
;F3::Shift
F24::Send("{WheelDown 7}")
F5::Send("{Esc}")
F6::
{
Send("{alt down}")
Send("{tab down}")
Send("{tab up}")
Send("{alt up}")
return
}
F7::
{
Sleep(300)
Send("{m}")
Send("{v}")
return
}
F8::Send("{Backspace}")
F9::
;Send("{Enter}")
{
    Send("{Ctrl down}")
    Send("{Space down}")
    Send("{Space up}")
    Send("{Ctrl up}")
    return
    }
F10::Send("{Enter}")
F11::Send("{Delete}")
F12::
{
Send("{Ctrl down}{F4 down}{F4 up}{Ctrl up}")
return
}
F3::
{
Send("{ctrl down}")
Send("{g down}")
Send("{g up}")
Send("{Ctrl up}")
return
}
;;;;;;;;;;;;;;;F13:: to block mouse/keyboard inputs ?????



Ctrl & Shift::
{
Sleep(300)
Send "{LButton}"
Send "{LButton}"
return
}
Shift & Ctrl::
{
Sleep(300)
Send("{Lbutton}")
return
}
^LWin::
{
Sleep(300)
Send("{ctrl down}")
Send("{Tab down}")
Send("{Tab up}")
Send("{Ctrl up}")
return
}
LWin & Ctrl::
{
Sleep(300)
Send("{ctrl down}")
Send("{Shift down}")
Send("{Tab down}")
Send("{Tab up}")
Send("{Shift up}")
Send("{Ctrl up}")
return
}
;;;;;;;;;;;;;;;;;;;;;Shift & LWin::
;;;;;;;;;;;;;;;;;;;;;LWin & Shift::
;;;;;;;;;;;;;;;;;;;;;<+F13::
;;;;;;;;;;;;;;;;;;;;;<+F14::
;;;;;;;;;;;;;;;;;;;;;<+F22::
;;;;;;;;;;;;;;;;;;;;;<+F23::
;;; ......  different combinations of the above





F14 & F21::
{
Send("{ctrl down}")
Send("{WheelUp}")
Send("{ctrl up}")
return
}
;F14 & F2::send "{WheelLeft}"  (may cause error of A_MaxHotkeysPerInterval when hold F2 down...??)
F14 & F5::send "{WheelRight}"
;;;;;;;;;;;;;;;;;F14 & Fx:



;;;;;;;;;;;;;;;;; other F3 button
F3 & LButton::
{
Sleep(300)
Send("{s}")
Send("{e}")
Return
}
F3 & Ctrl::
{
Sleep(300)
Send("{s}")
Send("{m}")
Return
}
F3 & Shift::
{
Sleep(300)
Send("{s}")
Send("{p}")
Return
}
F3 & WheelDown::
{
Sleep(300)
Send("{s}")
Send("{c}")
Return
}
F3 & WheelUp::
{
Sleep(300)
Send("{s}")
Send("{o}")
Return
}


;;;F21/F4 for the below!!!!
;;;;F3 & LButton::
;;;F3 & RButton::
;F3 & ::
;;;;F3 & ::





;;;;#IfWinActive, ahk_exe Revit.exe RButton & WheelUp::send {Click 292 275}
;;;;#IfWinActive, ahk_exe Revit.exe RButton & WheelDown::Send {Click 292 275}


;;;;;;;;;;;;;;;;^F13::
;;;;;;;;;;;;^F14:: (used in Mdgee mouse clicker)
^WheelUp::
{
Sleep(300)
Send "{RButton}"
return
}
^WheelDown::
{
Sleep(300)
Send("{Tab}")
return
}
^F21::
{
Sleep(300)
Send("{a}")
Send("{l}")
return
}
^F2::
{
Sleep(300)
Send("{t}")
Send("{r}")
return
}
^ & LShift::
{
Sleep(300)
Send("{d}")
Send("{i}")
return
}
^F24::
{
Sleep(300)
Send("{c}")
Send("{s}")
return
}
^F5::
{
Sleep(300)
Send("{m}")
Send("{a}")
return
}
^F6:: ;trim/extend
{
Sleep(300)
Send("{t}")
Send("{5}")
return
}
^F7::
{
Sleep(300)
Send("{c}")
Send("{o}")
return
}
^F8::Send("{Up}")
^F9::
{
Sleep(300)
Send("{f}")
Send("{f}")
return
}
^F10::Send("{Left}")
^F11::Send("{Down}")
^F12::Send("{Right}")



;<+LButton::
;;;;;<+Tab::
;;;;;<+F22-F23::
;;;;; didn't work? <+>#::
;;;;; didn't work? <+<#::
;;;
<+WheelUp:: ;paste align current view
{
Sleep(300)
Send("{p}")
Send("{a}")
return
}
<+WheelDown:: ;paste same place
{
Sleep(300)
Send("{p}")
Send("{s}")
return
}
<+F21::
{
Send("{ctrl down}")
Sleep(300)
Send("{z down}")
Sleep(300)
Send("{z up}")
Sleep(300)
Send("{Ctrl up}")
return
}
;<+F2:: (cause error of Shift+MButton to orbit in Revit...!!!??
<+F3::
{
Send("{ctrl down}")
Sleep(300)
Send("{a down}")
Sleep(300)
Send("{a up}")
Sleep(300)
Send("{Ctrl up}")
return
}
<+F24::
{
send "^x"
send "#x"
return
}
<+F5::
{
Send("{ctrl down}")
Sleep(300)
Send("{s down}")
Sleep(300)
Send("{s up}")
Sleep(300)
Send("{Ctrl up}")
Sleep(3000)
Reload()
return
}
<+F6::
{
CurrentDateTime := FormatTime(, "yyMMdd")
SendInput(CurrentDateTime)
Return
}
<+F7::
{
send "^c"
return
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<+F8::
<+F9::
{
Sleep(300)
Send("{t}")
Send("{g}")
return
}
<+F10::
{
send "^v"
return
}
<+F11::
{
Send("{ctrl down}")
Sleep(300)
Send("{f down}")
Sleep(300)
Send("{f up}")
Sleep(300)
Send("{Ctrl up}")
return
}
<+F12::Send("{h}")




F6 & LButton:: ; minimise window
{
Sleep(300)
Send("{LWin Down}")
Send("{Down down}")
Send("{Down up}")
Send("{Down down}")
Send("{Down up}")
Send("{LWin Up}")
return
}
;F6 & RButton::
;F6 & MButton::
;F6 & WheelUp::
;F6 & WheelDown::
;F6 & RShift::
;F6 & RCtrl::
;F6 & F5::
;F6 & F3::
;F6 & F9::
;;;;same for F8, F9, ... Combo


F7 & LButton::#Down
;F7 & Ctrl::#d
;;;;;F7 & F24::
;;;;F7 & F210::
F7 & F8::
{
Sleep(300)
Send("{c}")
Send("{i}")
return
;F7 & LWin::
}
F7 & F24::Volume_Down
F7 & F21::Volume_Up
F7 & Tab::Volume_Mute
;F7 & RShift::
/*
Sleep 300
send {ctrl down}
Sleep 300
send {F24 down}
Sleep 300
send {F24 up}
Sleep 300
send {Ctrl up}
return
*/


;;;;;F8 & = can't, because hold for continued delting


;F11 & LButton::ExitApp
;F11 & Ctrl::
;;;;;F11 & F8::
;;;;;F11 & F10::
;F11 & #::

; other F1-F12...  But can't MButton: hold for middle mouse button pan.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; why didn't work?
;F5 & Ctrl:: (jump backward YouTube below)
;F5 & Shift:: (jump forward YouTube below)
; F5 & WheelDown:: (play/stop YouTube below)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;F5 & Windows::  didn't work ?
F5 & WheelUp::
{
Sleep(300)
Send("{d}")
Send("{l}")
Return
}
F5 & LButton::

F5 & F13::
{
Sleep(300)
Send("{s}")
Send("{m}")
Return
}
F5 & F22::
{
Sleep(300)
Send("{s}")
Sleep(300)
Send("{o}")
Return
}
F5 & F24::
{
Sleep(300)
Send("{s}")
Send("{n}")
Return
;F5 & F6:: {clear stuck key below}
;;;;F5 & F8::
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#Shift::
#Ctrl::    ; double click
{
Sleep(300)
Send("{Lbutton}")
Send("{Lbutton}")
return
}
#F13::-
#F14::+
#F21::0
#F2::=
#F3::_
#F24::1
#F5::2
#F6::3
#F7::4
#F8::5
#F9::6
#F10::7
#F11::8
#F12::9



RButton::RButton
;;;;???RButton & RShift::!F10
RButton & Right::<^F4
RButton & Left::Volume_Mute
RButton & Up::<^PgUp
RButton & Down::<^PgDn
RButton & .::Volume_Down
RButton & /::Volume_Up
;  cannot use - conflict with click and drag... LButton::LButton

RButton::RButton
;;;;???RButton & RShift::!F10
RButton & Right::^F4
RButton & Left::Volume_Mute
RButton & Up::^PgUp
RButton & Down::^PgDn
RButton & .::Volume_Down
RButton & /::Volume_Up
;  cannot use - conflict with click and drag... LButton::LButton





;;;;<^q::
;;;;<^w::
;;;;<^e::



^+WheelUp::send("{Home}")
^+WheelDown::send("{End}")
^+F21::send("{z}")
^+F2::send("{a}")
^+F3::send("{q}")
^+F24::send("{x}")
^+F5::send("{s}")
^+F6::send("{w}")
^+F7::send("{c}")
^+F8::send("{d}")
^+F9::send("{e}")
^+F11::send("{f}")
^+F12::send("{r}")
^+LButton::send("{b}")
^+F13::send("{g}")
^+F14::send("{t}")
^+F22::send("{:}")
;;;???why couldn't work;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^+F23::send("{"}")

^#WheelUp::send("{PgUp}")
^#WheelDown::send("{PgDn}")
^#F21::send("{n}")
^#F2::send("{h}")
^#F3::send("{y}")
^#F24::send("{m}")
^#F5::send("{j}")
^#F6::send("{u}")
^#F7::send("{,}")
^#F8::send("{k}")
^#F9::send("{i}")
^#F10::send("{.}")
^#F11::send("{l}")
^#F12::send("{o}")
^#LButton::send("{/}")
^#F13::send("{;}")
^#F14::send("{p}")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^#F22::send("{}")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^#F23::send("{}")

+#WheelUp::send("{~}")
+#WheelDown::send("{`}")
+#F21::send("{!}")
+#F2::send("{@}")
+#F3::send("{#}")
+#F24::send("{$}")
+#F5::send("{%}")
+#F6::send("{^}")
+#F7::send("{&}")
+#F8::send("{*}")
+#F9::send("{()}")
+#F10::send("{<}")
+#F11::send("{>}")
+#F12::send("{?}")
+#LButton::send("{{}}")
+#F13::send("{}}")
+#F14::send("{|}")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+#F22::send("{}")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+#F23::send("{}")



;---STOP MOUSE MOVEMENT----
/
^!p::
KeyWait Control  ; Wait for the key to be released.  Use one KeyWait for each of the hotkey's modifiers.
KeyWait Alt
BlockInput On
; ... send keystrokes and mouse clicks ...
BlockInput Off
return
*/


;---CONTROL YOUTUBE----
#Requires AutoHotkey v2
#include Media.ahk
F5 & WheelDown::try Media.GetCurrentSession().TogglePlayPause()
F5 & Ctrl::{
    ;Sleep 500
    Loop 1 {
        Sleep 300
        try {
            session := Media.GetCurrentSession()
            if (position := session.Position) > 0 {
                session.ChangePlaybackPosition(Max(position-5, session.MinSeekTime))
                break
            }
        }
    }
}
F5 & Shift::{
    ;Sleep 500
    Loop 1 {
        Sleep 300
        try {
            session := Media.GetCurrentSession()
            if (position := session.Position) > 0 && (limit := session.MaxSeekTime) > 0 {
                session.ChangePlaybackPosition(Min(position+5, limit))
                break
            }
        }
        Sleep 500
    }
}
/* OLD 240305 
#Requires AutoHotkey v2
#include Media.ahk
^Space::try Media.GetCurrentSession().TogglePlayPause()
F5 & Shift::{  
    try {
        session := Media.GetCurrentSession()
        session.ChangePlaybackPosition(Max(session.Position-5, session.MinSeekTime))
    }
}
^l::{
    try {
        session := Media.GetCurrentSession()
        session.ChangePlaybackPosition(Min(session.Position+10, session.MaxSeekTime))
    }
}
*/





[Mod edit: Fixed code tags.]
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***

gregster
Posts: 9085
Joined: 30 Sep 2013, 06:48

Re: Why codes disabled my "6" key..?

Post by gregster » 01 May 2024, 06:14

I tried the first 700 lines - and it didn't disable 6.
Perhaps there is something in the included media.ahk...

I mean, it's all hotkeys. Should be easy to isolate the part which is creating problems by removing sections iteratively.

User avatar
boiler
Posts: 17192
Joined: 21 Dec 2014, 02:44

Re: Why codes disabled my "6" key..?

Post by boiler » 01 May 2024, 06:30

I believe it's the ^ & LShift:: hotkey since ^ is a shifted 6 on a standard US keyboard and the prefix key loses its native function. This kills the 6 key for me:

Code: Select all

^ & LShift::MsgBox

I'm not sure what you're trying to accomplish with that hotkey anyway. I can't even produce the MsgBox using any combination of keypresses with the above script.

gregster
Posts: 9085
Joined: 30 Sep 2013, 06:48

Re: Why codes disabled my "6" key..?

Post by gregster » 01 May 2024, 07:02

Good point, boiler.
On my german keyboard layout, ^ has its own key and can be reached without Shift (it's a dead key, though).
Here, the hotkey combo ^ & LShift::MsgBox triggers a msgbox - but it has no relation to the 6 key and doesn't disable it.
akirofe might have a third layout with different effects, or even using multiple layouts.

akirofe
Posts: 160
Joined: 05 Apr 2021, 21:54

Re: Why codes disabled my "6" key..?

Post by akirofe » 01 May 2024, 09:29

Short story: YOU guys are GENIOUS!!! Especially Boiler thank you sooooo much!!! And yes it's the "^ & LShift::" that disabled the "6"!!!! (and I use US ( Australia(?) ) QWERTY keyboard). LOVE YOU!!!!!!!
Extra info: as per my story in my signature... I do want lots of hot keys... And yes, when I fixed it to

Code: Select all

^LShift::{
Sleep(300)
Send("{d}")
Send("{i}")
return
}
I can now produce the "di" that I want for my Revit's command. :bravo: :bravo: :bravo: :bravo: :bravo:
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***

Post Reply

Return to “Ask for Help (v2)”