0

I want to add to this script so that during the disable period you ccan still use key 4 if you are holding alt shift or cntrl

The code I have disables the 4 key entirely for a duration after it's pressed.

  4WasPressedAt:=A_TickCount-5200       
  ~*4::4WasPressedAt:=A_TickCount       
  #if A_TickCount-4WasPressedAt<5200    
  *4::return

I would like to have it functional if another key is being held down during that time and then the same for the 3 key with a 4.8 second delay.

1 Answer 1

0

This can be done by adding more conditions to your #If. Please see my solution below. Note that a possible shortcoming is that the combinations of alt+4, shift+4, and ctrl+4 will only produce a 4. That is, the possible expected effect of typing those combinations, such as shift+4 to get $, will only produce a 4.

4WasPressedAt := A_TickCount - 5200

$*4::
4WasPressedAt := A_TickCount
Send , {4}
Return

#If (( A_TickCount - 4WasPressedAt ) < 5200 && !( GetKeyState( "Alt" ) || GetKeyState( "Shift" ) || GetKeyState( "Ctrl" )))
*4::Return
#If
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.