Go Back   Tech Support Forum > The IT Pro > Programming

automatic key presser (from web design and development)

This is a discussion on automatic key presser (from web design and development) within the Programming forums, part of the Tech Support Forum category. i have been reading some of the tutorials on the internet for creating a program that will make my computer


Reply
 
Thread Tools Search this Thread
Old 04-02-2012, 12:03 PM   #1
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



i have been reading some of the tutorials on the internet for creating a program that will make my computer press a couple of times in a second but they are too complicated and hard to understand. What i need it to do is when i press the button "z" it will make it press the button "x" about 5 times in one second until i press "z" again. Is there anyone that can help me with creating this kind of program?

__________________
NicKeRoT is offline   Reply With Quote
Old 04-02-2012, 12:43 PM   #2
Manager
- Alternative Computing
- Design
 
wmorri's Avatar
 
Join Date: May 2008
Location: New York
Posts: 5,733
OS: Window 7/Ubuntu/Fedora/Backtrack 5

My System

Send a message via AIM to wmorri Send a message via MSN to wmorri

Hi,

Welcome to TSF!!

Can you link a couple of those tutorials so that I can have a look at them and see if it is possible and how hard it would be to do.

__________________



Linux Forever!|html5 boilerplate
wmorri is offline   Reply With Quote
Old 04-02-2012, 12:48 PM   #3
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



I am thinking of using this program AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText and it doesn't look hard to do if you know how to do it :D. There is a quick start tutorial on the website. Also i have been looking at youtube videos such as these:
AutoHotKey Tutorial - Basics - YouTube


I see how they do theirs but i don't know how to make the one that i want...
__________________
NicKeRoT is offline   Reply With Quote
Old 04-02-2012, 01:11 PM   #4
Manager
- Alternative Computing
- Design
 
wmorri's Avatar
 
Join Date: May 2008
Location: New York
Posts: 5,733
OS: Window 7/Ubuntu/Fedora/Backtrack 5

My System

Send a message via AIM to wmorri Send a message via MSN to wmorri

Okay well this doesn't seem that difficult, but before I dive deep into how to make a script for this have you tired looking at the wiki and seeing if there is anything that can help you with it. If that isn't there I would search the forums too. If you don't find anything even similar to it then come back and I will try and find something.

Also, I am going to move your thread to the programming section as this really doesn't have anything to do with web design and development.
__________________



Linux Forever!|html5 boilerplate
wmorri is offline   Reply With Quote
Old 04-02-2012, 01:32 PM   #5
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



I have been looking for something like this for almost 2 weeks now and i can't find one that's similar to this. I have downloaded many programs like this and i found out that this is the only way to do it(by creating a script). Most of them want to press the mouse button and i'm not familiar with the commands so i really can't do it myself...
__________________
NicKeRoT is offline   Reply With Quote
Old 04-02-2012, 02:25 PM   #6
Manager
- Alternative Computing
- Design
 
wmorri's Avatar
 
Join Date: May 2008
Location: New York
Posts: 5,733
OS: Window 7/Ubuntu/Fedora/Backtrack 5

My System

Send a message via AIM to wmorri Send a message via MSN to wmorri

It is going to take me a bit to learn the syntax and then figure out how to write it. If you want a faster response you might want to post on their forums and see what they tell you.
__________________



Linux Forever!|html5 boilerplate
wmorri is offline   Reply With Quote
Old 04-03-2012, 02:23 AM   #7
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



i am not in a hurry and i can see that it would take a lot of time and if you can't do it its fine...
__________________
NicKeRoT is offline   Reply With Quote
Old 04-03-2012, 08:44 AM   #8
TSF-Emeritus
 
Ninjaboi's Avatar
 
Join Date: Dec 2010
Location: U.S.A., Texas
Posts: 2,047
OS: Windows XP SP3, Ubuntu 10

My System


Here's an application based on your specifications ( attached to this reply in a .zip compressed format ).

You simply double-click to run the application in the background and it will simulate 5 'x' key presses whenever you press 'z' on your keyboard. It does this in less than a second, so it's very quick.

Hope this is what you were wanting!
Attached Files
File Type: zip Script z to 5 x's.zip (363.7 KB, 20 views)
__________________
Ninjaboi is offline   Reply With Quote
Old 04-03-2012, 11:05 AM   #9
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



OMG thanks a lot only one thing it doesn't seem to work in the game that i want it to which is an internet game HaxBall - Play do you know why this would be?
__________________
NicKeRoT is offline   Reply With Quote
Old 04-03-2012, 11:46 AM   #10
TSF-Emeritus
 
Ninjaboi's Avatar
 
Join Date: Dec 2010
Location: U.S.A., Texas
Posts: 2,047
OS: Windows XP SP3, Ubuntu 10

My System


I'm not sure, I've never played that game before. Does it work inside other applications such as Notepad or another game?
__________________
Ninjaboi is offline   Reply With Quote
Old 04-22-2012, 12:15 PM   #11
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



i figured it out. The problem was that i needed the x button to be pressed with the smallest break possible after pressing the z button. What that program does is it just pastes xx instead of x and after a couple of milliseconds another x
__________________
NicKeRoT is offline   Reply With Quote
Old 04-22-2012, 02:43 PM   #12
TSF-Emeritus
 
Ninjaboi's Avatar
 
Join Date: Dec 2010
Location: U.S.A., Texas
Posts: 2,047
OS: Windows XP SP3, Ubuntu 10

My System


Quote:
The problem was that i needed the x button to be pressed with the smallest break possible after pressing the z button.
I am confused as to what you meant. I just performed a benchmark on this program, and it emulated the key press 'x' 5 times in less than 1/4 of a second ( 0.212 seconds was my fastest time with it ). That seems rather fast to me, as that's roughly 16-22 key presses a second being emulated. If it needs to be faster, there might be a way to trim it down a few milliseconds, but it still won't fall under 0.150 seconds from what I can imagine.

Quote:
x and after a couple of milliseconds another x
It sounds like you were wanting it to be even quicker in emulating the 5 key presses to perhaps less than 0.050 seconds. I don't think this can be done, as it takes a certain amount of time to take an event from the Windows events stack, process what to do with it, and send the 5 emulated key pressed back to Windows to be performed. This would be up to the speed of your processor, which mine is currently not the best in the world by far. The speed isn't capped, so if you can get it to perform quicker on your system then that will solve that issue.

Quote:
What that program does is it just pastes xx instead of x and after a couple of milliseconds another x
By 'pastes', do you mean that it sends the literal character value for 'x' instead of the key press of 'x'? Both can be done, but this program specifically emulates the key press of 'x' instead of sending the character 'x' to Windows applications. If you're not wanting the program to emulate the key presses one right after another and instead have delay between each key press, that can be done.

Example:

*Key Press 'X' is sent*
-DELAY 0.100 SECONDS-
*Key Press 'X' is sent*
-DELAY 0.100 SECONDS-
*Key Press 'X' is sent*
-DELAY 0.100 SECONDS-
*Key Press 'X' is sent*
-DELAY 0.100 SECONDS-
*Key Press 'X' is sent*

The time of delay can be whatever you need though, that's just an example.
__________________
Ninjaboi is offline   Reply With Quote
Old 04-23-2012, 03:54 PM   #13
Registered Member
 
Join Date: Apr 2012
Posts: 9
OS: Vista/Windows7



This is the final product
$LShift::
while GetKeyState("LShift", "P")
{
Send {x down}
sleep 10
Send {x up}
sleep 24
}
return

instead of z its shift and its not 5 x's in a second but that's what i was looking for. I guess the information i gave you was not so accurate...
__________________
NicKeRoT is offline   Reply With Quote
Old 04-23-2012, 06:49 PM   #14
TSF-Emeritus
 
Ninjaboi's Avatar
 
Join Date: Dec 2010
Location: U.S.A., Texas
Posts: 2,047
OS: Windows XP SP3, Ubuntu 10

My System


No problem, it would have been difficult for you to convey what you meant. You did the best to explain, I did the best to understand.

Glad you solved your problem though!

Happy scripting .

__________________
Ninjaboi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic key presser (from web design and development)
i have been reading some of the tutorials on the internet for creating a program that will make my computer press a couple of times in a second but they are too complicated and hard to understand. What i need it to do is when i press the button "z" it will make it press the button "x" about 5 times...
NicKeRoT Programming 13 04-23-2012 06:49 PM
SLI 8800 ultra and 8800 GTS
can i sli my ultra and 8800 gts ?! i would like to know if it is safe to do so, and if it would work.
josh714 Video Card Support 15 04-09-2012 10:37 AM
'Downgrade' from Windows Vista to Windows XP opinions
Hi, My parents computer (Dell Dimension E520) running Windows 7 is incredibly and painfully slow. In task manager the CPU usage runs at a consistent 100% when undertaking the simplest of tasks. I thought about upgrading their processor or alternatively upgrading to Windows 7, but am...
PeterH1988 Windows 7 Support, Windows Vista Support 10 04-08-2012 02:14 PM
Canon printer LBP6300DN and connectivity issue (ping)
Dear Experts Friend of mine discuss with me the below issue New canon LBP6300DN network printer installed for an office that has 10 computers XP, windows7.
zillah Printer Support 0 04-02-2012 09:01 AM
Transitioning from Residential to Small Business Customers?
As it is right now as a freelance computer tech my ideal situation is to have a number of computers infected with malware or need the operating system upgraded, dropped off at my home where I work on them. This allows for a fantastic profit every day with little effort and a troubleshooting zone...
BBLotus Certification & Career 2 04-02-2012 07:26 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2


All times are GMT -7. The time now is 01:40 PM.


Copyright 2001 - 2014, Tech Support Forum

Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts