| View previous topic :: View next topic |
| Author |
Message |
YoYoWazzup Guest
|
Posted: Tue May 13, 2008 12:44 pm Post subject: how to remap like this? |
|
|
hi i want middle button to click left twice when i click
but remapping MButton::LButton can only click once
and doing the below does not work because i want to press other keys at the same time i click Mbutton, any solution?
| Code: | MButton::
click left
click left
return |
second thing, please look at the this code
| Code: | tab::
send {tab}c
return |
pressin tab sends tab+c by this but it doesnt keep sending while i press tab down, i need to release button and press again to send the command.
but weird thing is that the code below keeps sending command while button is being pressed down. how come?
F1::
send {tab}c
return
thanks!!  |
|
| Back to top |
|
 |
sinkfaze
Joined: 19 Mar 2008 Posts: 138
|
Posted: Tue May 13, 2008 2:00 pm Post subject: Re: how to remap like this? |
|
|
| Code: | MButton::
Click 2
return |
| Code: | *TAB::
Send {Blind}{Tab DownTemp}{c DownTemp}
return
*TAB up::
Send {Blind}{Tab Up}{c Up}
return |
The reason F1 worked and Tab didn't is because Tab was one of the keys being sent in your script; the script was looking for you to press the Tab button down from a released(or up) state to activate it; holding it down prevented that. I think as written above it should work for you. _________________ Have trouble searching the site for information? Try Quick Search for Autohotkey. |
|
| Back to top |
|
 |
YoYoWazzup Guest
|
Posted: Wed May 14, 2008 8:03 am Post subject: |
|
|
thx^^ second code worked nicely
but tho the MButton, click 2 would do the same as click left click left as in my code, the problem is i hav to press shift and control when i want this Mbutton to work as double click so that making it a hotkey doesnt work, but i cant also remap it to double click..
 |
|
| Back to top |
|
 |
YoYoWazzup Guest
|
Posted: Wed May 14, 2008 9:09 am Post subject: |
|
|
sry for another question
code with Tab:: hotkey does not work when theres other hotkey including Tab, just like Tab & 1:: how to make them both work in one script please? |
|
| Back to top |
|
 |
YoYoWazzup Guest
|
Posted: Thu May 15, 2008 10:03 am Post subject: |
|
|
help me  |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 333
|
Posted: Fri May 16, 2008 6:42 am Post subject: |
|
|
Works for me!
| Code: | Tab::msgbox,Tab
Tab & 1::msgbox,Tab + 1 |
_________________
 |
|
| Back to top |
|
 |
YoYoWazzup Guest
|
Posted: Fri May 16, 2008 10:44 am Post subject: |
|
|
| Micahs wrote: | Works for me!
| Code: | Tab::msgbox,Tab
Tab & 1::msgbox,Tab + 1 |
|
yea this works but when Tab:: hotkey has to send {Tab} keystroke,
only Tab & 1:: works.. well *Tab works too if i release key but not like it keeps sending command just like it did when there wasnt tab & 1::
| Code: | *TAB::
Send {Blind}{Tab DownTemp}{c DownTemp}
return
*TAB up::
Send {Blind}{Tab Up}{c Up}
return
Tab & 1::msgbox,Tab + 1 |
hmm...? |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 333
|
Posted: Sat May 17, 2008 1:46 am Post subject: |
|
|
| Autohotkey Help wrote: | You can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:
Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0.
Numpad0 & Numpad2::Run Notepad
In the above example, Numpad0 becomes a prefix key; but this also causes Numpad0 to lose its original/native function when it is pressed by itself. To avoid this, a script may configure Numpad0 to perform a new action such as one of the following:
Numpad0::WinMaximize A ; Maximize the active/foreground window.
Numpad0::Send {Numpad0} ; Make the release of Numpad0 produce a Numpad0 keystroke. See comment below.The presence of one of the above hotkeys causes the release of Numpad0 to perform the indicated action, but only if you did not press any other keys while Numpad0 was being held down. | You might have to do things a little differently. _________________

Last edited by Micahs on Sat May 17, 2008 1:13 pm; edited 1 time in total |
|
| Back to top |
|
 |
YoYoWazzup Guest
|
Posted: Sat May 17, 2008 5:34 am Post subject: |
|
|
thx though i dont think that helps
what i exactly want is that when i hold down Tab key then
Tab:: hotkey including send{tab} command keeps sending command
for example, F1::hi, with this if u hold down F1 then it types in hihihihihihi unless u release F1
thanks to sinkfaze withe his code above, it worked
but now there is a problem that it nomore works if there is another hotkey like Tab & 1 in same ahk script.
| Code: | *TAB::
Send {Blind}{Tab DownTemp}{c DownTemp}
Send {Blind}{Tab Up}{c Up}
return |
THIS WORKS, KEEPS SENDING SEND LINES WHILE TAB PRESSED DOWN
| Code: | Tab::msgbox,Tab
Tab & 1::msgbox,Tab + 1 |
THIS WORKS TOO AS IT IS SUPPOSED TO
| Code: | *TAB::
Send {Blind}{Tab DownTemp}{c DownTemp}
Send {Blind}{Tab Up}{c Up}
return
Tab & 1::msgbox,Tab + 1
return |
now with this, TAB doesnt do send commands while it is being pressed down. i need to press, release press release Tab to do send commands.
it worked only by pressing down when Tab & 1 wasnt in the same script.
anybody please understand my problem:(? |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 333
|
Posted: Sat May 17, 2008 1:12 pm Post subject: |
|
|
Please read the help page above carefully.
When you do it this way, the Tab key becomes a prefix key. That means it looses its original/native function when it is pressed by itself. It will only fire when it is released. This is because when it it held down, the script knows that there might be another key to complete the sequence so it can't fire just on the Tab key being held down. When it is released, the script knows that it was just that one hotkey and not a combination, so it fires. Does this help? _________________
 |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 333
|
Posted: Sat May 17, 2008 2:14 pm Post subject: |
|
|
This probably is not exactly what you want, but it might get you started. Because of the way hotkeys work, you may have to brute-force it to get the combinations that you desire.
| Code: | $Tab::
Input, key, T.75, 12{Space} ;add any other characters to be end chars - 34567{Space}{Enter}, etc
;change .75 to any delay you need - this is the time limit you have to hit the 1,2, or space keys (or whatever you use.)
If(ErrorLevel = "EndKey:1")
{ MsgBox, Tab + 1
Return
}
Else If(ErrorLevel = "EndKey:2")
{ MsgBox, Tab + 2
Return
}
Else If(ErrorLevel = "EndKey:Space") ;add any other handlers here
{ MsgBox, Tab + Space
Return
}
Loop
{ Send {Blind}{Tab DownTemp}{c DownTemp}
Send {Blind}{Tab Up}{c Up}
If !GetKeyState("Tab","P")
{ Return
}
Sleep, 100 ;change this to set the typomatic rate
}
Return
|
_________________
 |
|
| Back to top |
|
 |
|