Sign in to follow this  
Followers 0
bennyvo

need help with key press

3 posts in this topic

hi,

i would like to have a script, that disable a specific (not all) key while another key is pressed.

eg.

if key A is pressed then

disable key B

end if

thanks alot. :(

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

hi,

i would like to have a script, that disable a specific (not all) key while another key is pressed.

eg.

if key A is pressed then

disable key B

end if

thanks alot. :(

<{POST_SNAPBACK}>

This blockes the "b" key if the "a" key is used before the "b" key. The only thing is that it blockes the key until the script is closed. I hope this helps.

While 1
    Select
        Case _IsPressed(41); 41 is the hexkey for the letter "A" 
            HotKeySet("b","_blockB"); If a key is set as a hotkey
        ;then the key only does the function it is set to.
    EndSelect
WEnd

Func _IsPressed($hexKey)
Local $aR, $bRv
$hexKey = '0x' & $hexKey
$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)

If $aR[0] <> 0 Then
    $bRv = 1
Else
    $bRv = 0
EndIf

Return $bRv
EndFunc  
Func _BlockB(); a funtion that does nothing, just used for the hotkey.
EndFunc
Edited by quick_sliver007

.

Share this post


Link to post
Share on other sites

thanks for the reply, it work fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0