Jump to content

problem with HotKeySet..


xcxooxl
 Share

Recommended Posts

im trying to make a program that will press on a key when i hold ctrl and press another key

when i leave ctrl..

thats the code.. for some reason it doesnt work =/ any idea?

Global $Paused
HotKeySet("{ctrldown}", "DA" )
HotKeySet("{ctrlup}", "DB")

While 1
    Sleep(100)
WEnd

Func DB()
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
EndFunc

Func DA()
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
EndFunc
Edited by xcxooxl
Link to comment
Share on other sites

Just to make sure I understand: You want a program that activates the first function when you press ctrl + B, and then a different function if you just press B?

The reason your code isn't working is that ctrldown and ctrlup are not actually keychecks, they are key commands. Ctrldown tells the computer to hold down the ctrl key until ctrlup is sent, so it won't work for your hotkey.

Try this instead:

HotkeySet("^B", "DA") ;this one is ctrl + the B key.

HotkeySet("B", "DB") ;this one is just the B key.

Link to comment
Share on other sites

im trying to make a program that will press on a key when i hold ctrl and press another key

when i leave ctrl..

thats the code.. for some reason it doesnt work =/ any idea?

Global $Paused
HotKeySet("{ctrldown}", "DA" )
HotKeySet("{ctrlup}", "DB")

While 1
    Sleep(100)
WEnd

Func DB()
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
    Send( "{HOME}" )
EndFunc

Func DA()
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
    Send( "{INSERT}" )
EndFunc

Look in the help file for HotkeySet and you will find a list of keys that can not be used.

Click here for a possible solution I posted earlier

Bowmore

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

first i want to say i want that when i hold ctrl it will press on somthing

and when i leave ctrl it will press somthing else

and Bowmore i visited in the topic you posted here..

and i saw this code

While _IsPressed("46")

Sleep(100)

WEnd

46 suppose to be the key of somthing right?

then whats the key of ctrl?

and where can i get list of numbers and keys?

and 1 more thing..

while _Ispressd suppose to make an action while a key is pressed

but i need an action that after i done pressing ctrl it will press somthing else

how can i do that ?

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...