xcxooxl Posted November 3, 2007 Share Posted November 3, 2007 (edited) 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 November 3, 2007 by xcxooxl Link to comment Share on other sites More sharing options...
Stalker0 Posted November 3, 2007 Share Posted November 3, 2007 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 More sharing options...
Achilles Posted November 3, 2007 Share Posted November 3, 2007 You can't use Ctrl in a hotkey set function. Look at _IsPressed in the helpfile... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Bowmore Posted November 3, 2007 Share Posted November 3, 2007 (edited) 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 November 3, 2007 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 More sharing options...
xcxooxl Posted November 4, 2007 Author Share Posted November 4, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now