One button to +1 number
One button to +1 number
I have keyboard Microsoft sidewinder x4, the keyboard support "macro keys". I want (in to notepad) use ONE button to write +1 (for example one press: 1, next press: 2, ...)
-
- Posts: 19
- Joined: 28 Apr 2017, 18:54
Re: One button to +1 number
Code: Select all
1::
IfWinActive, Untitled - Notepad
{
send, %number%
NUMBER += 1
}
Re: One button to +1 number
Sorry but I am beginner If I press 1 nothing happen
-
- Posts: 216
- Joined: 30 Jun 2016, 06:01
Re: One button to +1 number
There are 3 problems with eduardo's script. First, he didn't use the $ prefix to keep the hotkey from triggering itself, meaning it would start at 2, second he initiated the number variable after the first send, third he assumed the title of your notepad window was "Untitled - Notepad" when it usually won't be.
This should work.
This should work.
Code: Select all
$1::
number++
send % number
Return
-
- Posts: 19
- Joined: 28 Apr 2017, 18:54
Re: One button to +1 number
Thanks, I was too lazy indeed, just copied straight from WinActive article and made some changes, sorry.
intentions were good
intentions were good
neomulemi6 wrote:There are 3 problems with eduardo's script. First, he didn't use the $ prefix to keep the hotkey from triggering itself, meaning it would start at 2, second he initiated the number variable after the first send, third he assumed the title of your notepad window was "Untitled - Notepad" when it usually won't be.
This should work.
Code: Select all
$1:: number++ send % number Return
Re: One button to +1 number
Thanks for advice.
One more question. I select some text , now I paste them (in correct place) by click cursor + "paste".Is possible tocopy PASTE them immediately after click without function key "paste"?
One more question. I select some text , now I paste them (in correct place) by click cursor + "paste".Is possible to
Last edited by greg111 on 01 May 2017, 02:41, edited 1 time in total.
-
- Posts: 19
- Joined: 28 Apr 2017, 18:54
Re: One button to +1 number
!=Alt
^=Control
+=Shift
https://autohotkey.com/docs/misc/Clipboard.htm
^=Control
+=Shift
https://autohotkey.com/docs/misc/Clipboard.htm
Code: Select all
send, ^c ;copy
send, ^v ;paste
Re: One button to +1 number
I made a mistake, I want paste previously selected text when I click LBmouse
I found code:
work fine but if I click MButton
I have script to copy but how paste by Left Button mouse
I found code:
Code: Select all
~LButton:: ; Make the left mouse button a hotkey, but allow it to function as normal.
MouseGetPos, xA, yA
loop ; Begin a loop.
{
Sleep, 10 ; Wait 10 milliseconds.
GetKeyState, LButton_state, LButton, P ; Check on the status of the left mouse button.
if LButton_state = U ; If the left mouse button has been released.
{
MouseGetPos, xB, yB
Transform, xA, abs, %xA% ; Return the absolute value of xA.
Transform, xB, abs, %xB%
Transform, yA, abs, %yA%
Transform, yB, abs, %yB%
xDiff = 0
xDiff += %xA% ; Add xA to xDiff.
xDiff -= %xB% ; Subtract xA from xDiff.
Transform, xDiff, abs, %xDiff%
yDiff = 0
yDiff += %yA%
yDiff -= %yB%
Transform, yDiff, abs, %yDiff%
diffSum = 0
diffSum += %xDiff%
diffSum += %yDiff%
If diffSum > 10
{
Send, ^c ; Copy.
clipboard = %clipboard% ; Convert the cliboard contents to plain text.
}
break
}
}
return
MButton:: ; Make the middle mouse button a hotkey, and _don't_ allow it to function as normal.
send, ^v ; Paste
return
I have script to copy but how paste by Left Button mouse
-
- Posts: 216
- Joined: 30 Jun 2016, 06:01
Re: One button to +1 number
LButton::Send ^v