i need a little help creating a complicated script
basically i want to create a script like this
example
if i press letter 'W' then it will send W
but when I hit W again for the second time , it will not send or do anything because
the last previous keyboard pressed is 'W'
more clarification or example
you cannot type
WWHEAT , WWAR
ps : If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 400)
i really dont want to use this command
i hope someone can help
Need a Little Help for creating Script
-
- Posts: 59
- Joined: 12 Jan 2015, 18:36
Need a Little Help for creating Script
Last edited by noobgraphicartist on 21 Apr 2017, 07:33, edited 1 time in total.
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Need a Little Help for creating Script
Not sure what you are trying to accomplish, but:
turns WW into W when you type it.
Code: Select all
:*:WW::W
-
- Posts: 59
- Joined: 12 Jan 2015, 18:36
Re: Need a Little Help for creating Script
thanks for fast replyWalkerOfTheDay wrote:Not sure what you are trying to accomplish, but:
turns WW into W when you type it.Code: Select all
:*:WW::W
sadly this is not im looking for
to elaborate more
i am going to use the script mainly for Zbrush
in Zbrush when i assigned W as keyboard shortcut key for ZADD
the function is toggling in cycle mode ( ON / OFF)
which i really dont want
i want to disable the OFF
so i come up with the idea and dont know if its possible in AHK
if i press letter 'W' then it will send W
but when I hit W again for the second time , it will not send or do anything because
the last previous keyboard pressed is 'W'
Re: Need a Little Help for creating Script
I have a few ideas that might be useful:
The hotkeys may interfere with hotstrings.
This prevents any letter, or its capital being repeated.
This prevents w, or its capital being repeated. If any of q/e/r/t/y is pressed, they work as normal, but allow w to be pressed once more, although you will still not be able to repeat w.
Based on the problem you described, something like this may be desirable. You can only press w once per window, although if the window title changes, you will be able to press w once more.
More simply, you can only press w once per window.
The hotkeys may interfere with hotstrings.
This prevents any letter, or its capital being repeated.
Code: Select all
Hotkey, IfWinActive, ahk_class Notepad
Loop, 26
{
Hotkey, % "$" Chr(96+A_Index), MyLabel
Hotkey, % "$+" Chr(96+A_Index), MyLabel
}
return
MyLabel:
vLetter := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
if !(vLetter = vLetterLast)
if InStr(A_ThisHotkey, "+")
SendInput, % "+" vLetter
else
SendInput, % vLetter
vLetterLast := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
return
Code: Select all
~q::
~e::
~r::
~t::
~y::
vLetterLast := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
return
$w::
vLetter := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
if !(vLetter = vLetterLast)
SendInput, % vLetter
vLetterLast := SubStr(A_ThisHotkey, StrLen(A_ThisHotkey))
return
Code: Select all
$w::
WinGet, hWnd, ID, A
WinGetTitle, vWinTitle, % "ahk_id " hWnd
if !vWinListBlock
vWinListBlock := "`n"
if !InStr(vWinListBlock, "`n" hWnd "`t" vWinTitle "`n")
{
SendInput w
vWinListBlock .= hWnd "`t" vWinTitle "`n"
}
return
Code: Select all
$w::
WinGet, hWnd, ID, A
if !vWinListBlock
vWinListBlock := ","
if !InStr(vWinListBlock, "," hWnd ",")
{
SendInput w
vWinListBlock .= hWnd ","
}
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: OrangeCat and 294 guests