Jump to content

Press only 1 button in the IsPressed function Is it possible to use send 2 keys by toggle?


Recommended Posts

I just want to press one button to send the key to job which will be sent alternately when pressed 1 time

    Send MouseWheel($MOUSE_WHEEL_UP, 5)

and when pressed again will send

    MouseWheel($MOUSE_WHEEL_DOWN , 5)

Please make an example for me, thank you very much. If there are many samples i will be very grateful

my example

Func _start()
    $i = 0
        Do
            If _IsPressed("34", $hDLL) Then
            MouseWheel($MOUSE_WHEEL_UP, 5)
            

            ElseIf _IsPressed("34", $hDLL) Then
            MouseWheel($MOUSE_WHEEL_DOWN  , 5)
            

            EndIf
        Sleep(10)
        Until $i = 1
EndFunc

 

Edited by Melba23
Link to comment
Share on other sites

@freeday7123  :welcome:

Quote

I just want to press one button to send the key to job

which will be sent alternately when pressed 1 time

Send MouseWheel($MOUSE_WHEEL_UP, 5)

and when pressed again will send

MouseWheel($MOUSE_WHEEL_DOWN , 5)

Please make an example for me, thank you very much.

If there are many samples i will be very grateful

my example:

Func _start()
    $i = 0
        Do
            If _IsPressed("34", $hDLL) Then
            MouseWheel($MOUSE_WHEEL_UP, 5)
            

            ElseIf _IsPressed("34", $hDLL) Then
            MouseWheel($MOUSE_WHEEL_DOWN  , 5)
            

            EndIf
        Sleep(10)
        Until $i = 1
EndFunc

:) it looks better that way 

How to post code on the forum

 

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

@freeday7123 is this OK ?

#include <AutoItConstants.au3>
#include <Misc.au3>

$i = 0
Do
    If _IsPressed("61") Then        ; 61 Numeric keypad 1 key
        MouseWheel($MOUSE_WHEEL_UP, 5)
    ElseIf _IsPressed("60") Then    ;  60 Numeric keypad 0 key
        MouseWheel($MOUSE_WHEEL_DOWN, 5)
    EndIf

    Sleep(10)

Until $i = 1

 

I know that I know nothing

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...