Basically, I have a problem with my keybord when it's automatically changing profiles. (Different profiles for chrome, desktop, word etc because of different hotkeys)
These problems occur, when the profile changes while you are holding a key. Often, it will think that you are still pressing a key, even if you dont.
For example, when I tab into chrome with alt+tab, it will keep alt and tab pushed down, which is pretty annoying (try it). These problems occur with CTRL and ALT-Tab because those are generally the keys i have pushed down when changing profiles.
Basically, I would like a script, that performs an action when alt&tab is pushed down together for a certain amount of time (which i will have to figure out myself). What action that is, I will have to figure out on my own aswell, but there arent many options:
- Send {'t Up}
- Send {'t}
Could someone please help me with detecting the keystrokes?
If Alt&Tab held for certain amount of time, release tab
Re: If Alt&Tab held for certain amount of time, release tab
1st: do something when alt+tab is pressed : https://autohotkey.com/docs/Hotkeys.htm
2nd: Create a loop : https://autohotkey.com/docs/commands/Loop.htm / https://autohotkey.com/docs/commands/Return.htm / https://autohotkey.com/docs/commands/Sleep.htm
3rd: Check if the keys are still pressed (if not return) : https://autohotkey.com/docs/commands/GetKeyState.htm
4th: Send Tab up if both keys are still pressed : https://autohotkey.com/docs/commands/Send.htm
If there are better solutions for this you can correct me
Code: Select all
~!Tab::
Code: Select all
~!Tab::
Loop, 10 ; Loops 10 times
{
Sleep, 100 ; Waits 0,1 Seconds
}
return
Code: Select all
~!Tab::
Loop, 10
{
if(!GetKeyState("Alt") and !GetKeyState("Tab", "p")) ; Checks if Alt and Tab are released
{
return
}
Sleep, 100
}
return
Code: Select all
~!Tab::
Loop, 10
{
if(!GetKeyState("Alt") and !(GetKeyState("Tab", "p")))
{
return
}
Sleep, 100
}
if(GetKeyState("Alt") and GetKeyState("Tab", "p"))
{
Send, {Tab up}
}
return
return
Who is online
Users browsing this forum: Araphen, Oblomov228 and 172 guests